fi.hut.tml.xsmiles.timesheet.timer
Class Timer.Clock

java.lang.Object
  extended byfi.hut.tml.xsmiles.timesheet.timer.Timer.Clock
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
Timer

protected class Timer.Clock
extends java.lang.Object
implements java.lang.Runnable

Class Clock produces one clock tick every INTERVAL milliseconds


Constructor Summary
protected Timer.Clock()
           
 
Method Summary
 boolean isRunning()
           
 void run()
           
 void start()
           
 void stopTime()
          Stops the clock.
 void waitForTick(long lastTick)
          Timer instances call this method to wait for the next clock tick.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Timer.Clock

protected Timer.Clock()
Method Detail

run

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

isRunning

public boolean isRunning()

start

public void start()

stopTime

public void stopTime()
Stops the clock. Blocks until the clock is finished.


waitForTick

public void waitForTick(long lastTick)
Timer instances call this method to wait for the next clock tick. If Timer has fallen behind time, method returns immediately, so that Timer can catch up with the clock.

Parameters:
lastTick - the caller's own ticknumber


X-Smiles 1.2