freemarker.template
Class UpdateTimer

java.lang.Object
  |
  +--freemarker.template.UpdateTimer

public class UpdateTimer
extends java.lang.Object
implements java.lang.Runnable

A timer for objects that implement Updatable. Creates a new thread, in which it periodically calls the Updatable's update() method.


Constructor Summary
UpdateTimer()
           
UpdateTimer(Updatable target, long delay)
           
 
Method Summary
 void run()
           
 void setDelay(long delay)
           
 void setTarget(Updatable target)
           
 void startTiming()
          Begins periodic automatic updates of the target.
 void stopTiming()
          Stops automatically updating the target.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpdateTimer

public UpdateTimer()

UpdateTimer

public UpdateTimer(Updatable target,
                   long delay)
Parameters:
target - the object to be updated.
delay - the number of milliseconds between updates.
Method Detail

setTarget

public void setTarget(Updatable target)
Parameters:
target - the object to be updated.

setDelay

public void setDelay(long delay)
Parameters:
delay - the number of milliseconds between updates.

startTiming

public void startTiming()
Begins periodic automatic updates of the target.

stopTiming

public void stopTiming()
Stops automatically updating the target.

run

public void run()
Specified by:
run in interface java.lang.Runnable