public class Firing extends ScheduleElement
It is more efficient to use this class than to simply maintain a list of actors since actors will often fire multiple times consecutively. Using this class (and the Schedule data structure in general) greatly reduces the memory requirements of most large schedules.
Schedule
,
ScheduleElement
_parent
Constructor and Description |
---|
Firing()
Construct a firing with a default iteration count equal to one
and with no parent schedule.
|
Firing(Actor actor)
Construct a firing with a actor, an iteration count equal to one
and no parent schedule.
|
Modifier and Type | Method and Description |
---|---|
java.util.Iterator |
actorIterator()
Return the actor invocation sequence of the schedule in the
form of a sequence of actors.
|
java.util.Iterator |
firingIterator()
Return the actor invocation sequence in the form
of a sequence of firings.
|
Actor |
getActor()
Get the actor associated with this Firing.
|
void |
setActor(Actor actor)
Set the actor associated with this firing.
|
java.lang.String |
toString()
Output a string representation of this Firing.
|
_getVersion, _incrementVersion, getIterationCount, setIterationCount, setParent
public Firing()
public Firing(Actor actor)
actor
- The actor in the firing.public java.util.Iterator actorIterator()
A runtime exception is thrown if the underlying schedule structure is modified while the iterator is active.
actorIterator
in class ScheduleElement
java.util.ConcurrentModificationException
- If the
underlying schedule structure is modified while the iterator
is active.public java.util.Iterator firingIterator()
A runtime exception is thrown if the underlying schedule structure is modified while the iterator is active.
firingIterator
in class ScheduleElement
java.util.ConcurrentModificationException
- If the
underlying schedule structure is modified while the iterator
is active.public Actor getActor()
setActor(Actor)
public void setActor(Actor actor)
actor
- The actor to associate with this firing.getActor()
public java.lang.String toString()
toString
in class java.lang.Object