|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.cesilko.rachota.core.Clock
public class Clock
System clock ticking every second by default.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Method Summary | |
---|---|
void |
addListener(ClockListener listener)
Adds new clock listener. |
static Clock |
getDefault()
Returns default instance of Clock object. |
boolean |
isTicking()
Returns whether clock is ticking or not. |
void |
removeListener(ClockListener listener)
Removes already registered clock listener. |
void |
resumeClock()
Starts clock again. |
void |
run()
Main clock loop. |
void |
setTick(long tick)
Sets period of one clock tick. |
void |
suspendClock()
Temporarily stops clock. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static Clock getDefault()
public void setTick(long tick)
tick
- Clock period i.e. time between two notifications to listeners.public void addListener(ClockListener listener)
listener
- Object who whats to be notified after each tick.public void removeListener(ClockListener listener)
listener
- Object who no longer whats to be notified after each tick.public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void suspendClock()
public void resumeClock()
public boolean isTicking()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |