hypercast.adapters
Class Timer

java.lang.Object
  |
  +--hypercast.adapters.Timer

public class Timer
extends java.lang.Object

This class provides synchronized access for a thread to a TimerEventQueue. It also provides for waiting until an event. NOTE: Calls to this object use delays, while the times in the TimerEventQueue are absolute!!!


Constructor Summary
Timer()
          Constructs a Timer object which contains a TimerEventQueue.
 
Method Summary
 void clearTimer(java.lang.Object timeID)
          Removes a TimerEvent from the TimerEventQueue.
 long getTimer(java.lang.Object timeID)
          Return delay until a timer goes off.
static void main(java.lang.String[] args)
           
 void setTimer(java.lang.Object timeID, long delay)
          Adds a TimerEvent to the TimerEventQueue.
 java.lang.Object sleepUntilNextEvent()
          Returns after a certain amount of time.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Timer

public Timer()
Constructs a Timer object which contains a TimerEventQueue.

Method Detail

setTimer

public void setTimer(java.lang.Object timeID,
                     long delay)
Adds a TimerEvent to the TimerEventQueue.

Parameters:
timeID - the id of a time event
delay - the time value in ms

getTimer

public long getTimer(java.lang.Object timeID)
Return delay until a timer goes off.


clearTimer

public void clearTimer(java.lang.Object timeID)
Removes a TimerEvent from the TimerEventQueue.

Parameters:
timeID - the id of the time event to be removed

sleepUntilNextEvent

public java.lang.Object sleepUntilNextEvent()
                                     throws java.lang.InterruptedException
Returns after a certain amount of time.

java.lang.InterruptedException

main

public static void main(java.lang.String[] args)