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

Variable Index

 o handler
The alarm event handler.
 o time
The absolute time, in ms, when to the alarm handler.

Constructor Index

 o Alarm(AlarmHandler)
Creates a new alarm for the specified handler.
 o Alarm(long, AlarmHandler)
Creates a new alarm for the specified time and handler.

Method Index

 o getTime()
Returns the absolute time for this alarm event.
 o setTime(long)
Sets the absolute time for this alarm event.
 o setTimeFromNow(long)
Sets the relative time for this alarm event.

Variables

 o time
 protected long time
The absolute time, in ms, when to the alarm handler.

 o handler
 protected AlarmHandler handler
The alarm event handler.

Constructors

 o 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
 o Alarm
 public Alarm(AlarmHandler handler)
Creates a new alarm for the specified handler.

Parameters:
handler - the alarm event handler

Methods

 o setTime
 public void setTime(long time)
Sets the absolute time for this alarm event.

Parameters:
time - the absolute time, in ms
 o setTimeFromNow
 public void setTimeFromNow(long time)
Sets the relative time for this alarm event.

Parameters:
time - the relative time from now, in ms
 o 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