planet.util.timer
Class ThreadTimerTask

java.lang.Object
  extended by java.util.TimerTask
      extended by planet.util.timer.ThreadTimerTask
All Implemented Interfaces:
java.io.Serializable, java.lang.Runnable, TimerTask

public abstract class ThreadTimerTask
extends java.util.TimerTask
implements TimerTask

This concrete implementation extends the java.util.TimerTask and adapt this implementation to use the superclass. It is required to implement TimerTask to use with ThreadTimer.

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

Constructor Summary
ThreadTimerTask()
          Initialize this TimerTask.
 
Method Summary
 boolean cancel()
          Cancels this TimerTask.
 boolean isFinished()
          Inform if this TimerTask has been cancelled.
abstract  void run()
          Implements this method to make the concrete necessary job.
 
Methods inherited from class java.util.TimerTask
scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadTimerTask

public ThreadTimerTask()
Initialize this TimerTask.

Method Detail

cancel

public boolean cancel()
Cancels this TimerTask. If this task is in execution it normally finish.

Specified by:
cancel in interface TimerTask
Overrides:
cancel in class java.util.TimerTask
Returns:
true if it avoid almost one execution of this task.
See Also:
TimerTask.cancel()

run

public abstract void run()
Implements this method to make the concrete necessary job.

Specified by:
run in interface java.lang.Runnable
Specified by:
run in interface TimerTask
Specified by:
run in class java.util.TimerTask
See Also:
TimerTask.run()

isFinished

public boolean isFinished()
Inform if this TimerTask has been cancelled.

Specified by:
isFinished in interface TimerTask
Returns:
true if this TimerTask has been cancelled.
See Also:
TimerTask.isFinished()