Class ChronometerClock

java.lang.Object
org.episteme.social.history.clock.Clock
org.episteme.social.history.clock.ChronometerClock
All Implemented Interfaces:
Serializable, EventListener, TimeListener

public class ChronometerClock extends Clock
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 Details

    • ChronometerClock

      public ChronometerClock(TimeServer timeServer)
      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

      public ModernTime getTime()
      Returns the elapsed time duration as a ModernTime offset.
      Specified by:
      getTime in class Clock
      Returns:
      elapsed time
    • timeChanged

      public void timeChanged(TimeEvent event)
      Description copied from interface: TimeListener
      Invoked when a time change occurs on the monitored TimeServer.
      Parameters:
      event - the event containing the new time state