tcl.lang
Class TimerHandler

java.lang.Object
  extended by tcl.lang.TimerHandler

public abstract class TimerHandler
extends Object

This abstract class is used to define timer handlers.


Constructor Summary
TimerHandler(Notifier n, long milliseconds)
          Create a timer handler to be fired after the given time lapse.
 
Method Summary
 void cancel()
          Mark this timer handler as cancelled so that it won't be invoked.
abstract  void processTimerEvent()
          This method is called when the timer is expired.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimerHandler

public TimerHandler(Notifier n,
                    long milliseconds)
Create a timer handler to be fired after the given time lapse. Side effects: The timer is registered in the list of timers in the given notifier. After milliseconds have elapsed, the processTimerEvent() method will be invoked exactly once inside the primary thread of the notifier.

Parameters:
n - The notifier to fire the event
milliseconds - number of milliseconds to wait before invoking processTimerEvent()
Method Detail

cancel

public void cancel()
Mark this timer handler as cancelled so that it won't be invoked. Side effects: The timer handler is marked as cancelled so that its processTimerEvent() method will not be called. If the timer has already fired, then nothing this call has no effect.


processTimerEvent

public abstract void processTimerEvent()
This method is called when the timer is expired. Override This method to implement your own timer handlers.



Copyright © 2015. All rights reserved.