|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.indi.reactor.TimerHandler
org.indi.reactor.SimpleTimer
public class SimpleTimer
A simplifyed version of the TimerHandler class taking a given delay in miliseconds instead of an expiration Date and a class implementing TimerCallback interface to be called back after the given delay.
Constructor Summary | |
---|---|
SimpleTimer(TimerCallback callback,
long timeout)
Class constructor |
Method Summary | |
---|---|
void |
onTimer()
Called by the reactor when the delay has passed. |
static java.util.Date |
shift(java.util.Date date,
long mills)
Shift a given Date object by a certain number of miliseconds |
Methods inherited from class org.indi.reactor.TimerHandler |
---|
compareTo, equals, getExpirationDate |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleTimer(TimerCallback callback, long timeout)
callback
- the object containing the callback method to be called
after the given delaytimeout
- the delay to wait before calling the callback method in
milliseconds.Method Detail |
---|
public static java.util.Date shift(java.util.Date date, long mills)
date
- the date object to be shiftedmills
- the number of milliseconds to shift the timout by
public void onTimer()
onTimer
in interface TimerCallback
onTimer
in class TimerHandler
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |