public class SimpleTimer extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
SimpleTimer.TimedEvent
Simple interface for events to be queued up and notified on expiration
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEvent(SimpleTimer.TimedEvent event,
long timeoutMs)
Queue up the given event to be fired no sooner than timeoutMs from now.
|
void |
addEvent(SimpleTimer.TimedEvent event,
long timeoutMs,
boolean useEarliestTime)
Queue up the given event to be fired no sooner than timeoutMs from now.
|
boolean |
removeEvent(SimpleTimer.TimedEvent evt) |
void |
removeSimpleTimer()
Removes the SimpleTimer.
|
void |
reschedule(SimpleTimer.TimedEvent event,
long timeoutMs)
Reschedule an existing event.
|
public void addEvent(SimpleTimer.TimedEvent event, long timeoutMs)
event - the event to scheduletimeoutMs - the delay in milliseconds before the event should firepublic void addEvent(SimpleTimer.TimedEvent event, long timeoutMs, boolean useEarliestTime)
event - the event to scheduletimeoutMs - the delay in milliseconds before the event should fireuseEarliestTime - if already scheduled, use the earlier of the
two timeouts, else use the laterpublic boolean removeEvent(SimpleTimer.TimedEvent evt)
public void removeSimpleTimer()
public void reschedule(SimpleTimer.TimedEvent event, long timeoutMs)
event - the event to rescheduletimeoutMs - the new timeout in milliseconds