Package repast.simphony.engine.schedule
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 Summary
Constructors Constructor Description ActionList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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<ISchedulableAction>
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
-
-
-
-
Method Detail
-
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 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.
-
-