|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.generic.util.Timer
The Timer class provides a way to execute a
Runnable when the end of a fixed period has been reached.
The periods are divided into the first period after the Timer
has been started and all periods that follow.
| Constructor Summary | |
Timer()
Constructor for Timer. |
|
| Method Summary | |
java.lang.Thread |
getThread()
Returns the Thread the Timer runs within. |
boolean |
hasStopped()
Returns a flag which indicates that the Timer has been
stopped. |
void |
run()
|
protected void |
start()
Starts the Thread belonging to this Timer
-object. |
void |
start(java.lang.Runnable runnable,
int initialPeriod,
int period)
This method has to be called to start the Timer. |
void |
stop()
This method has to be called to stop the Timer. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Timer()
Timer.
| Method Detail |
public boolean hasStopped()
Timer has been
stopped.
Timer has been stopped.public java.lang.Thread getThread()
Thread the Timer runs within.
Thread this timer belongs to.
public void start(java.lang.Runnable runnable,
int initialPeriod,
int period)
Timer. The method
run() of the given Runnable is called whenever
the end of a period has been reached.
runnable - the Runnable to start whenever the end
of a period has been reached.initialPeriod - the delay in milliseconds for the first period after
the timer has been started.period - the delay in milliseconds for all periods without
the first after the timer has been started.public void stop()
Timer.
protected void start()
Thread belonging to this Timer
-object.
public void run()
run in interface java.lang.Runnable
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||