|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.liquidatom.derbyscore.domain.Clock
@ThreadSafe public class Clock
A basic implementation of a clock which keeps track of time as it elapses and provides hooks for listeners to be notified when certain events occur on the clock.
Constructor Summary | |
---|---|
Clock(Duration duration,
boolean padMinutes)
|
Method Summary | |
---|---|
boolean |
addListener(ClockListener listener)
|
void |
begin()
Start this clock running. |
void |
beginAndSynchronizeTo(Clock clock)
|
void |
end()
End the execution of this clock. |
protected void |
fireOnBegin()
|
protected void |
fireOnChanged()
|
protected void |
fireOnEnd()
|
protected void |
fireOnPause()
|
protected void |
fireOnResume()
|
protected void |
fireOnTerminate()
|
java.lang.String |
getDisplayTime()
|
boolean |
isEnded()
|
boolean |
isPaused()
|
boolean |
isTerminated()
|
void |
pause()
Pause the execution of this clock. |
java.util.concurrent.locks.Lock |
readLock()
|
boolean |
removeListener(ClockListener listener)
|
void |
reset(Duration duration)
|
void |
resume()
Resume execution of the clock. |
void |
terminate()
|
void |
tick(long currentTimeMillis)
|
java.util.concurrent.locks.Lock |
writeLock()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Clock(Duration duration, boolean padMinutes)
Method Detail |
---|
public boolean addListener(ClockListener listener)
public boolean removeListener(ClockListener listener)
protected void fireOnChanged()
protected void fireOnBegin()
protected void fireOnEnd()
protected void fireOnTerminate()
protected void fireOnPause()
protected void fireOnResume()
public boolean isEnded()
public void terminate()
public boolean isTerminated()
public boolean isPaused()
public void pause()
public void resume()
public void reset(Duration duration)
public java.lang.String getDisplayTime()
public void begin()
public void beginAndSynchronizeTo(Clock clock)
public void end()
public void tick(long currentTimeMillis)
public java.util.concurrent.locks.Lock readLock()
readLock
in interface java.util.concurrent.locks.ReadWriteLock
public java.util.concurrent.locks.Lock writeLock()
writeLock
in interface java.util.concurrent.locks.ReadWriteLock
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |