All Packages Class Hierarchy This Package Previous Next Index
Class sun.server.util.Alarm
java.lang.Object
|
+----sun.server.util.Alarm
- public class Alarm
- extends Object
This class represents an alarm for the alarm event manager.
- See Also:
- AlarmManager
-
handler
- The alarm event handler.
-
time
- The absolute time, in ms, when to the alarm handler.
-
Alarm(AlarmHandler)
- Creates a new alarm for the specified handler.
-
Alarm(long, AlarmHandler)
- Creates a new alarm for the specified time and handler.
-
getTime()
- Returns the absolute time for this alarm event.
-
setTime(long)
- Sets the absolute time for this alarm event.
-
setTimeFromNow(long)
- Sets the relative time for this alarm event.
time
protected long time
- The absolute time, in ms, when to the alarm handler.
handler
protected AlarmHandler handler
- The alarm event handler.
Alarm
public Alarm(long time,
AlarmHandler handler)
- Creates a new alarm for the specified time and handler.
- Parameters:
- time - the absolute time, in ms, when to invoke the handler
- handler - the alarm event handler
Alarm
public Alarm(AlarmHandler handler)
- Creates a new alarm for the specified handler.
- Parameters:
- handler - the alarm event handler
setTime
public void setTime(long time)
- Sets the absolute time for this alarm event.
- Parameters:
- time - the absolute time, in ms
setTimeFromNow
public void setTimeFromNow(long time)
- Sets the relative time for this alarm event.
- Parameters:
- time - the relative time from now, in ms
getTime
public long getTime()
- Returns the absolute time for this alarm event.
- Returns:
- the absolute time, in ms
All Packages Class Hierarchy This Package Previous Next Index