planet.util.timer
Class ThreadTimer

java.lang.Object
  extended byjava.util.Timer
      extended byplanet.util.timer.ThreadTimer
All Implemented Interfaces:
java.io.Serializable, Timer

public class ThreadTimer
extends java.util.Timer
implements Timer

Implements a Timer based with java.util.Timer, with a non daemon mode.

Author:
Jordi Pujol Date: 07/05/2004
See Also:
Serialized Form

Constructor Summary
ThreadTimer()
          Builds a new ThreadTimer, invoking the java.util.Timer.Timer() constructor.
 
Method Summary
 void setTimerTask(TimerTask task, long delay)
          Sets a new TimerTask to schedule for only one activation.
 void setTimerTask(TimerTask task, long delay, long period)
          Sets a new TimerTask to schedule periodicly.
 
Methods inherited from class java.util.Timer
cancel, schedule, schedule, schedule, schedule, scheduleAtFixedRate, scheduleAtFixedRate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface planet.util.timer.Timer
cancel
 

Constructor Detail

ThreadTimer

public ThreadTimer()
Builds a new ThreadTimer, invoking the java.util.Timer.Timer() constructor.

Method Detail

setTimerTask

public void setTimerTask(TimerTask task,
                         long delay)
Sets a new TimerTask to schedule for only one activation. If the TimerTask not extends java.util.TimerTask, this method will throw a ClassCastException at runtime.

Specified by:
setTimerTask in interface Timer
Parameters:
task - TimerTask that must extends java.util.TimerTask
delay - Time in millis for the first invocation.
See Also:
Timer.setTimerTask(planet.util.timer.TimerTask, long)

setTimerTask

public void setTimerTask(TimerTask task,
                         long delay,
                         long period)
Sets a new TimerTask to schedule periodicly. If the TimerTask not extends java.util.TimerTask, this method will throw a ClassCastException at runtime.

Specified by:
setTimerTask in interface Timer
Parameters:
task - TimerTask that must extends java.util.TimerTask
delay - Time in millis for the first invocation.
period - Time in millis between each activation of this TimerTask.
See Also:
Timer.setTimerTask(planet.util.timer.TimerTask, long, long)


===== END OF BOTTOM NAVBAR ======= -->