Class ChronometerClock
java.lang.Object
org.episteme.social.history.clock.Clock
org.episteme.social.history.clock.ChronometerClock
- All Implemented Interfaces:
Serializable, EventListener, TimeListener
A chronometer (stopwatch) implementation that measures elapsed time.
Calculates duration relative to a start time captured from a
TimeServer.
* @version 1.1- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionChronometerClock(TimeServer timeServer) Creates a new ChronometerClock associated with a time server. -
Method Summary
Modifier and TypeMethodDescriptiongetTime()Returns the elapsed time duration as aModernTimeoffset.voidreset()Resets the elapsed time and schedules a new start time capture.voidstart()Starts the underlying time server.voidstop()Stops the underlying time server.voidtimeChanged(TimeEvent event) Invoked when a time change occurs on the monitoredTimeServer.Methods inherited from class Clock
getTimeServer, toString
-
Constructor Details
-
ChronometerClock
Creates a new ChronometerClock associated with a time server.- Parameters:
timeServer- the time server to monitor
-
-
Method Details
-
start
public void start()Starts the underlying time server. -
stop
public void stop()Stops the underlying time server. -
reset
public void reset()Resets the elapsed time and schedules a new start time capture. -
getTime
Returns the elapsed time duration as aModernTimeoffset. -
timeChanged
Description copied from interface:TimeListenerInvoked when a time change occurs on the monitoredTimeServer.- Parameters:
event- the event containing the new time state
-