|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.lang.Thread
|
+--org.kaariboga.util.SimpleTimer
A simple timer. This timer calls onSimpleTimer() of a SimpleTimerListener in regular time intervals.
SimpleTimerListener| Field Summary | |
protected long |
interval
interval to wait between notifications |
protected SimpleTimerListener |
listener
The class, that is notified by this timer. |
protected boolean |
reset
used to indicate if this timer has been reset |
protected boolean |
shouldLive
used to control, if this thread should terminate |
| Fields inherited from class java.lang.Thread |
contextClassLoader, daemon, eetop, group, inheritableThreadLocals, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadLocals, threadQ |
| Constructor Summary | |
SimpleTimer(long interval,
boolean startImmediately,
SimpleTimerListener listener)
Creates a new Timer that notifies it's listener once in every interval |
|
| Method Summary | |
void |
reset()
Resets this timer. |
void |
run()
Just waits a specified time and notifies the listener. |
void |
terminate()
Terminates this timer. |
| Methods inherited from class java.lang.Thread |
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected long interval
protected SimpleTimerListener listener
protected volatile boolean shouldLive
protected volatile boolean reset
| Constructor Detail |
public SimpleTimer(long interval,
boolean startImmediately,
SimpleTimerListener listener)
interval - Interval in milliseconds this timer notifies the listenerstartImmeiately - Determines if the timer should start or wait for the
first interval before calling onSimpleTimer.agent - The agent, that is notified by this timer| Method Detail |
public void run()
run in class java.lang.Threadpublic void reset()
public void terminate()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||