Package repast.simphony.engine.schedule
Class ActionList
java.lang.Object
repast.simphony.engine.schedule.ActionList
- All Implemented Interfaces:
Iterable<ISchedulableAction>
A list of IActions.
- Author:
- Nick Collier
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(ISchedulableAction action) Adds the specified action.voidaddAllNoSort(ActionList other) Adds all the elements in the other list to this one without marking this as dirty and needing to be sorted.voidaddNoSort(int index, ISchedulableAction action) Adds the specified action at the specifed index without marking the list as dirty and needing to be sorted.voidaddNoSort(ISchedulableAction action) Adds the specified action without marking the list as dirty and needing to be sorted.voidclear()Clears this list of any elements it contains.voiddelete(int n) Deletes the first N number of elements from this list.iterator()booleanremove(ISchedulableAction action) Removes the specified action.voidshuffle()Shuffles the elements of this list.intsize()Gets the size of this list.voidsort(Comparator<ISchedulableAction> comp, boolean force) Sorts this list using the specified Comparator.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ActionList
public ActionList()
-
-
Method Details
-
clear
public void clear()Clears this list of any elements it contains. -
add
Adds the specified action.- Parameters:
action- the action to add
-
addNoSort
Adds the specified action without marking the list as dirty and needing to be sorted.- Parameters:
action- the action to add
-
addNoSort
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
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
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
Sorts this list using the specified Comparator.- Parameters:
comp-force- if true this will always sort regardless.
-
iterator
- Specified by:
iteratorin interfaceIterable<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.
-