|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.emory.mathcs.util.concurrent.AlarmClock
This class provide some value-added over java.util.Timer: that is, it enables rescheduling of previously scheduled tasks.
Note: it seems that cancelling the task and scheduling a new one in such case usually leads to better designs, so this (experimental) class may not be that useful after all.
Constructor Summary | |
AlarmClock(java.util.Timer engine,
java.lang.Runnable task)
|
Method Summary | |
boolean |
cancel()
Cancel the scheduled task. |
boolean |
setAlarmDelay(long delay)
Reschedule previously scheduled task. |
void |
setAlarmDelayIfSooner(long delay)
Reschedule previously scheduled task unless it would postpone it. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AlarmClock(java.util.Timer engine, java.lang.Runnable task)
Method Detail |
public void setAlarmDelayIfSooner(long delay)
delay
- the new delay before the task is to be executed,
measured from the moment the method is invoked.
public boolean setAlarmDelay(long delay)
delay
- the new delay before the task is to be executed,
measured from the moment the method is invoked.
public boolean cancel()
TimerTask.cancel()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |