|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectfi.hut.tml.xsmiles.timesheet.timer.Timer
Class Timer is the scheduler for TimedElement instances. Timer listens for ticks that are produced by static singleton instance of the inner class Clock. By every tick the Timer calls the update(long)-method of the registered TimedElement instances.
| Nested Class Summary | |
protected class |
Timer.Clock
Class Clock produces one clock tick every INTERVAL milliseconds |
| Field Summary | |
protected Timer.Clock |
clock
|
protected static int |
INTERVAL
The interval for ticks |
| Constructor Summary | |
Timer(TimedElement root)
Creates the Timer instance |
|
| Method Summary | |
void |
pause(boolean paused)
|
void |
run()
|
void |
setClocker(Clocker clocker)
|
void |
start()
Starts the Timer |
void |
stop()
Stops Timer |
static long |
ticksToTime(long ticks)
|
static long |
timeToTicks(long millis)
Converts milliseconds, used in the attributes of Timesheets into ticks |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final int INTERVAL
protected final Timer.Clock clock
| Constructor Detail |
public Timer(TimedElement root)
| Method Detail |
public void setClocker(Clocker clocker)
public static long timeToTicks(long millis)
millis - the time used in timesheets
public static long ticksToTime(long ticks)
public void start()
public void pause(boolean paused)
public void stop()
public void run()
run in interface java.lang.Runnable
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||