com.samskivert.util
Class Interval.IntervalTask

java.lang.Object
  extended by java.util.TimerTask
      extended by com.samskivert.util.Interval.IntervalTask
All Implemented Interfaces:
Runnable
Enclosing class:
Interval

protected static class Interval.IntervalTask
extends TimerTask

The task that schedules actually runs the interval.


Field Summary
protected  Interval _interval
          The interval this task is for.
protected  Interval.RunBuddy _runner
          If we are using a RunQueue, the Runnable we post to it.
 
Constructor Summary
Interval.IntervalTask(Interval interval)
           
 
Method Summary
 boolean cancel()
           
 void run()
           
 
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
 

Field Detail

_runner

protected Interval.RunBuddy _runner
If we are using a RunQueue, the Runnable we post to it.


_interval

protected Interval _interval
The interval this task is for. We have this reference back to our interval rather than just being a non-static inner class because when a TimerTask is cancelled it still sits on the Timer's queue until its execution time is reached. We want any references held by the interval to be collectable during this period, so our cancel removes the reference back to the Interval.

Constructor Detail

Interval.IntervalTask

public Interval.IntervalTask(Interval interval)
Method Detail

cancel

public boolean cancel()
Overrides:
cancel in class TimerTask

run

public void run()
Specified by:
run in interface Runnable
Specified by:
run in class TimerTask


Copyright © 2000-2008 Michael Bayne. All Rights Reserved.