Class TimeServer
java.lang.Object
org.episteme.social.history.clock.TimeServer
- Direct Known Subclasses:
LocalTimeServer, NetworkTimeServer
An abstract base class for chronological services capable of broadcasting time updates to listeners.
Concrete implementations may represent real-time clocks, simulation engines, or network-synchronized services.
- Since:
- 1.0
- Version:
- 1.1
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTimeListener(TimeListener listener) Adds a listener to be notified of time updates.voidPropagates a time event to all registered listeners.Returns an array of all currently registered time listeners.voidremoveTimeListener(TimeListener listener) Removes a listener from the notification list.abstract voidstart()Activates the time server, initiating update broadcasts.abstract voidstop()Deactivates the time server, halting all broadcasts.
-
Constructor Details
-
TimeServer
public TimeServer()
-
-
Method Details
-
start
public abstract void start()Activates the time server, initiating update broadcasts. -
stop
public abstract void stop()Deactivates the time server, halting all broadcasts. -
dispatchTimeEvent
Propagates a time event to all registered listeners.- Parameters:
evt- the time event to dispatch- Throws:
NullPointerException- if event is null
-
addTimeListener
Adds a listener to be notified of time updates.- Parameters:
listener- the observer to add- Throws:
NullPointerException- if listener is null
-
removeTimeListener
Removes a listener from the notification list.- Parameters:
listener- the observer to remove
-
getTimeListeners
Returns an array of all currently registered time listeners.- Returns:
- array of listeners (may be empty)
-