|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.actor.util.PeriodicDirectorHelper
public class PeriodicDirectorHelper
This is a helper class for directors implementing PeriodicDirector. It collects common functionality to avoid code duplication.
PeriodicDirector
Red (eal) |
Yellow (eal) |
Field Summary | |
---|---|
private PeriodicDirector |
_director
The associated director. |
private Time |
_nextFiringTime
The expected next firing time. |
Constructor Summary | |
---|---|
PeriodicDirectorHelper(PeriodicDirector director)
Construct a new helper. |
Method Summary | |
---|---|
private Time |
_fireContainerAt(Time time)
Request a firing of the container of the director at the specified time and throw an exception if the executive director does not agree to do it at the requested time. |
Time |
fireAt(Actor actor,
Time time)
Request a firing of the given actor at the given absolute time, and return the time at which the specified will be fired. |
void |
initialize()
If the period parameter is greater than zero, then request a first firing of the executive director, if there is one. |
void |
postfire()
If the period parameter is greater than 0.0, then if the associated director is at the top level, then increment its time by the specified period, and otherwise request a refiring at the current time plus the period. |
boolean |
prefire()
If the period value is greater than zero, then return true if the current time is a multiple of the value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private PeriodicDirector _director
private Time _nextFiringTime
Constructor Detail |
---|
public PeriodicDirectorHelper(PeriodicDirector director) throws IllegalActionException
director
- The associated director.
IllegalActionException
- If the argument is not an instance of
Director.Method Detail |
---|
public Time fireAt(Actor actor, Time time) throws IllegalActionException
actor
- The actor scheduled to be fired.time
- The requested time.
IllegalActionException
- If the operation is not
permissible (e.g. the given time is in the past).public void initialize() throws IllegalActionException
IllegalActionException
- If the superclass throws it.public void postfire() throws IllegalActionException
IllegalActionException
- If the period parameter
cannot be evaluated.public boolean prefire() throws IllegalActionException
IllegalActionException
- If the period
parameter cannot be evaluated.private Time _fireContainerAt(Time time) throws IllegalActionException
time
- The requested time.
IllegalActionException
- If the director does not
agree to fire the actor at the specified time, or if there
is no director.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |