Class ActionList

java.lang.Object
repast.simphony.engine.schedule.ActionList
All Implemented Interfaces:
Iterable<ISchedulableAction>

public class ActionList extends Object implements Iterable<ISchedulableAction>
A list of IActions.
Author:
Nick Collier
  • Constructor Details

    • ActionList

      public ActionList()
  • Method Details

    • clear

      public void clear()
      Clears this list of any elements it contains.
    • add

      public void add(ISchedulableAction action)
      Adds the specified action.
      Parameters:
      action - the action to add
    • addNoSort

      public void addNoSort(ISchedulableAction action)
      Adds the specified action without marking the list as dirty and needing to be sorted.
      Parameters:
      action - the action to add
    • addNoSort

      public void addNoSort(int index, ISchedulableAction action)
      Adds the specified action at the specifed index without marking the list as dirty and needing to be sorted.
      Parameters:
      action - the action to add
    • addAllNoSort

      public void addAllNoSort(ActionList other)
      Adds all the elements in the other list to this one without marking this as dirty and needing to be sorted.
      Parameters:
      other - the list to add
    • remove

      public boolean remove(ISchedulableAction action)
      Removes the specified action.
      Parameters:
      action -
      Returns:
      true if the action was removed, otherwise false.
    • size

      public int size()
      Gets the size of this list.
      Returns:
      the size of this list.
    • shuffle

      public void shuffle()
      Shuffles the elements of this list.
    • sort

      public void sort(Comparator<ISchedulableAction> comp, boolean force)
      Sorts this list using the specified Comparator.
      Parameters:
      comp -
      force - if true this will always sort regardless.
    • iterator

      public Iterator<ISchedulableAction> iterator()
      Specified by:
      iterator in interface Iterable<ISchedulableAction>
    • delete

      public void delete(int n)
      Deletes the first N number of elements from this list.
      Parameters:
      n - the number of elements to delete.