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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(ISchedulableAction action) Adds the specified action.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.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.void
addNoSort
(ISchedulableAction action) Adds the specified action without marking the list as dirty and needing to be sorted.void
clear()
Clears this list of any elements it contains.void
delete
(int n) Deletes the first N number of elements from this list.iterator()
boolean
remove
(ISchedulableAction action) Removes the specified action.void
shuffle()
Shuffles the elements of this list.int
size()
Gets the size of this list.void
sort
(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, wait
Methods 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:
iterator
in 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.
-