Class TimerFactory.Timer

java.lang.Object
  extended by RDTTimer
      extended by TimerFactory.Timer
Enclosing class:
TimerFactory

public class TimerFactory.Timer
extends RDTTimer

A TimerFactory.Timer times tasks that need to be performed at a later time.

A TimerFactory.Timer has a task and a delay. The delay determines the interval of time between starting the timer and performing the task. A TimerFactory.Timer is is either an active state or a stopped state. When it is in an active state it has a scheduled time, which is the time when its task will be performed. When it is in a stopped state its task has no scheduled time.


Constructor Summary
TimerFactory.Timer(long del, TimingTask tsk)
          new Timer(del, tsk) returns a new Timer that performs task tsk.
 
Method Summary
 void start()
          tmr.start() sets the scheduled time for tmr's task to the current time plus tmr's delay.
 void start(long del)
          tmr.start(del) sets the scheduled time for tmr's task to the current time plus del.
 void stop()
          tmr.stop() puts tmr in the stopped state.
 java.lang.String toString()
          tmr.toString() returns a String of the form name"-Timer-"id where name is the name of the TimerFactory that created tmr and id is the identification number of tmr.
 
Methods inherited from class RDTTimer
getPacket, setPacket
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimerFactory.Timer

public TimerFactory.Timer(long del,
                          TimingTask tsk)
new Timer(del, tsk) returns a new Timer that performs task tsk. Its delay is del.

Method Detail

start

public void start()
tmr.start() sets the scheduled time for tmr's task to the current time plus tmr's delay.

Specified by:
start in class RDTTimer

start

public void start(long del)
tmr.start(del) sets the scheduled time for tmr's task to the current time plus del.

Specified by:
start in class RDTTimer

stop

public void stop()
tmr.stop() puts tmr in the stopped state.

Specified by:
stop in class RDTTimer

toString

public java.lang.String toString()
tmr.toString() returns a String of the form name"-Timer-"id where name is the name of the TimerFactory that created tmr and id is the identification number of tmr.

Overrides:
toString in class java.lang.Object