Class Clock
java.lang.Object
org.episteme.social.history.clock.Clock
- All Implemented Interfaces:
Serializable, EventListener, TimeListener
- Direct Known Subclasses:
AlarmClock, BasicClock, ChronometerClock, CountdownClock
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 Summary
ConstructorsModifierConstructorDescriptionprotectedClock(TimeServer timeServer) Creates a new Clock synchronized with the specified time server. -
Method Summary
Modifier and TypeMethodDescriptionabstract TimegetTime()Returns the current time representation held by this clock.final TimeServerReturns the time server associated with this clock.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface TimeListener
timeChanged
-
Constructor Details
-
Clock
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
Returns the time server associated with this clock.- Returns:
- the time server
-
getTime
Returns the current time representation held by this clock.- Returns:
- the current time
-
toString
-