|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.planeth.common.timing.Timer
Timer implementation
A Timer is always bound to two main components.
A TimedObjectThread which is the motor of the timer.
A IFunctionPointer which represents the timer task.
The IFunctionPointer is executed once by default.
The number of executions can be defined using the "iterations" flag
or it can be set to infinite.
TimedObjectThread,
WaitTimer,
TimerManager| Constructor Summary | |
Timer(int waitMillis,
IFunctionPointer functionPointer)
Constructor for Timer. |
|
Timer(int waitMillis,
IFunctionPointer functionPointer,
int iterations)
Constructor for Timer. |
|
| Method Summary | |
void |
doNextStep()
Does the next step |
void |
interupt()
Interupts the Timer |
boolean |
isReadyToDie()
Returns true, if the IThreadControllable is ready to die Ready to die means, the Thread which controls the IThreadControllable, will terminate and the IThreadControllable will be deleted. |
void |
pause(boolean pauseState)
Pauses/unpauses the timer |
void |
setReadyToDie()
Sets the IThreadControllable ready to die. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Timer(int waitMillis,
IFunctionPointer functionPointer)
waitMillis - the main time to wait until execution of the IFunctionPointerfunctionPointer - a pointer interface to the code to be executed
public Timer(int waitMillis,
IFunctionPointer functionPointer,
int iterations)
waitMillis - the main time to wait until execution of the IFunctionPointerfunctionPointer - a pointer interface to the code to be executediterations - defines the number of executions (timer iterations) to be done| Method Detail |
public void doNextStep()
IThreadControllable
doNextStep in interface IThreadControllableIThreadControllable.doNextStep()public boolean isReadyToDie()
IThreadControllable
isReadyToDie in interface IThreadControllableIThreadControllable.isReadyToDie()public void setReadyToDie()
IThreadControllable
setReadyToDie in interface IThreadControllableIThreadControllable.setReadyToDie()public void interupt()
public void pause(boolean pauseState)
pause in interface ITimeControllablepauseState - ITimeControllable.pause(boolean)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||