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

Variable Index

 o arg
An optional argument that is passed to the targets alarmCall() method.
 o target
The target Alarmable object.
 o time
The alarm delay.

Constructor Index

 o Alarm(int, Alarmable)
Creates an Alarm that will call back the specified Alarmable object after the specified delay.
 o Alarm(int, Alarmable, Object)
Creates an Alarm that will call back the specified Alarmable object after the specified delay, with the specified argument.

Method Index

 o run()
Sleeps for the specified delay and then calls the targets alarmCall() method.

Variables

 o target
  protected Alarmable target
The target Alarmable object.
 o arg
  protected Object arg
An optional argument that is passed to the targets alarmCall() method.
 o time
  protected int time
The alarm delay.

Constructors

 o 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
 o 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

Methods

 o 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