Class prominence.util.Alarm
All Packages Class Hierarchy This Package Previous Next Index
Class prominence.util.Alarm
java.lang.Object
|
+----java.lang.Thread
|
+----prominence.util.Alarm
- public class Alarm
- extends Thread
A Thread that will call back an object that implements the
Alarmable interface after a specified length of time has
elapsed.
- See Also:
- Alarmable
-
arg
- An optional argument that is passed to the targets alarmCall() method.
-
target
- The target Alarmable object.
-
time
- The alarm delay.
-
Alarm(int, Alarmable)
- Creates an Alarm that will call back the specified Alarmable
object after the specified delay.
-
Alarm(int, Alarmable, Object)
- Creates an Alarm that will call back the specified Alarmable
object after the specified delay, with the specified argument.
-
run()
- Sleeps for the specified delay and then calls the targets alarmCall() method.
target
protected Alarmable target
- The target Alarmable object.
arg
protected Object arg
- An optional argument that is passed to the targets alarmCall() method.
time
protected int time
- The alarm delay.
Alarm
public Alarm(int time,
Alarmable target)
- Creates an Alarm that will call back the specified Alarmable
object after the specified delay.
The Alarm thread does not start automatically; you must call the
start() method.
- Parameters:
- time - The alarm delay (milliseconds)
- target - The target of the alarm callback
- See Also:
- start
Alarm
public Alarm(int time,
Alarmable target,
Object arg)
- Creates an Alarm that will call back the specified Alarmable
object after the specified delay, with the specified argument.
The Alarm thread does not start automaticaly; you must call the
start() method.
- Parameters:
- time - The alarm delay (milliseconds)
- target - The target of the alarm callback
- arg - An argument passed to the targets alarmCall() method.
- See Also:
- start
run
public void run()
- Sleeps for the specified delay and then calls the targets alarmCall() method.
- Overrides:
- run in class Thread
- See Also:
- alarmCall
All Packages Class Hierarchy This Package Previous Next Index