public class AlarmHeap
extends java.lang.Object
A separate thread periodically tests the queue for alarms ready.
Constructor and Description |
---|
AlarmHeap()
Create a new wakeup alarm with a designated listener as a callback.
|
Modifier and Type | Method and Description |
---|---|
void |
dequeue(Alarm alarm) |
Alarm |
extractAlarm(long now)
Returns the next alarm ready to run
|
boolean |
queueAt(Alarm alarm,
long wakeTime)
Queue the alarm for wakeup.
|
Alarm[] |
toArray() |
java.lang.String |
toString() |
public AlarmHeap()
public Alarm extractAlarm(long now)
public boolean queueAt(Alarm alarm, long wakeTime)
delta
- time in milliseconds to wakepublic void dequeue(Alarm alarm)
public Alarm[] toArray()
public java.lang.String toString()
toString
in class java.lang.Object