Class Clock

java.lang.Object
org.episteme.social.history.clock.Clock
All Implemented Interfaces:
Serializable, EventListener, TimeListener
Direct Known Subclasses:
AlarmClock, BasicClock, ChronometerClock, CountdownClock

public abstract class Clock extends Object implements TimeListener, Serializable
An abstract base class for clock implementations that observe a TimeServer. A clock maintains a reference to a time server and reacts to its chronological updates.
Since:
1.0
Version:
1.1
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • Constructor Details

    • Clock

      protected Clock(TimeServer timeServer)
      Creates a new Clock synchronized with the specified time server.
      Parameters:
      timeServer - the source of chronological updates
      Throws:
      NullPointerException - if timeServer is null
  • Method Details

    • getTimeServer

      public final TimeServer getTimeServer()
      Returns the time server associated with this clock.
      Returns:
      the time server
    • getTime

      public abstract Time getTime()
      Returns the current time representation held by this clock.
      Returns:
      the current time
    • toString

      public String toString()
      Overrides:
      toString in class Object