|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectplanet.util.timer.SimulationTimerImpl
Implements the contract that is specified by the SimulationTimer
interface. This permits schedule differents task for only one node.
Is important to know that is in a simulation environment. For that
reason, all time is measured in steps.
Constructor Summary | |
SimulationTimerImpl()
Initialize a Vector to contain all scheduled TimerTask. |
Method Summary | |
void |
cancel()
Cancels all scheduled tasks. |
void |
currentStep(int step)
Informs to the Timer that the actual step is step and permits to advise to differents taks for their timeouts. |
void |
setTimerTask(TimerTask task,
long delay)
Permits add a task for only one execution after delay steps. |
void |
setTimerTask(TimerTask task,
long delay,
long period)
Permits add a task for repeatly execution, the first time after delay steps, and others after period steps. |
java.lang.String |
toString()
Shows in String format the representation of this Timer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SimulationTimerImpl()
Method Detail |
public void currentStep(int step)
currentStep
in interface SimulationTimer
step
- SimulationTimer.currentStep(int)
public void setTimerTask(TimerTask task, long delay)
setTimerTask
in interface Timer
task
- TimerTask with action to do after delay steps.delay
- Number of steps to wait for to schedule the task.Timer.setTimerTask(planet.util.timer.TimerTask, long)
public void setTimerTask(TimerTask task, long delay, long period)
setTimerTask
in interface Timer
task
- TimerTask with action to do after delay steps, and
after period steps.delay
- Number of steps to wait for to schedule the task.period
- Number of steps to wait for others scheduling of the task.Timer.setTimerTask(planet.util.timer.TimerTask, long, long)
public void cancel()
cancel
in interface Timer
Timer.cancel()
public java.lang.String toString()
Object.toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |