public abstract class AbstractTimeService extends AbstractSreService implements TimeService
Constructor and Description |
---|
AbstractTimeService(listeners : SmartListenerCollection<TimeListener>)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addTimeListener(listener : TimeListener)
Add listener on time changes.
|
protected void |
fireTimeChanged()
Notifies about time changes.
|
double |
fromOSDuration(timeDuration : double)
Convert the given duration from the operating system time scale to the agent system time scale.
|
double |
fromOSTime(timeValue : double)
Convert the given time from the operating system time scale to the agent system time scale.
|
long |
getOSCurrentTime()
Replies the OS current time.
|
void |
removeTimeListener(listener : TimeListener)
Remove listener on time changes.
|
double |
toOSDuration(timeDuration : double)
Convert the given duration from the agent system time scale to the operating system time scale.
|
double |
toOSTime(timeValue : double)
Convert the given time from the agent system time scale to the operating system time scale.
|
doStart, doStop, onStart, onStop
addListener, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, doCancelStart, failureCause, isRunning, notifyFailed, notifyStarted, notifyStopped, startAsync, state, stopAsync, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
evolveTimeIfPossible, getOSTimeFactor, getTime, getTimePrecision, setTimeIfPossible
public new
(listeners : SmartListenerCollection<TimeListener>)
listeners
- the empty collection of listeners that must be used by this service.@Pure
public def
getOSCurrentTime() : long
TimeService
getOSCurrentTime
in interface TimeService
public def
fromOSDuration(timeDuration : double) : double
TimeService
TimeService.getOSTimeFactor()
for converting the duration.fromOSDuration
in interface TimeService
timeDuration
- the duration for the operating system.public def
fromOSTime(timeValue : double) : double
TimeService
TimeService.getOSTimeFactor()
for converting the duration.fromOSTime
in interface TimeService
timeValue
- the time for the operating system.@Pure
public def
toOSDuration(timeDuration : double) : double
TimeService
TimeService.getOSTimeFactor()
for converting the duration.toOSDuration
in interface TimeService
timeDuration
- the duration for the agent system.@Pure
public def
toOSTime(timeValue : double) : double
TimeService
TimeService.getOSTimeFactor()
for converting the time.toOSTime
in interface TimeService
timeValue
- the time for the agent system.protected def
fireTimeChanged() : void
AbstractTimeService
public def
addTimeListener(listener : TimeListener) : void
TimeService
addTimeListener
in interface TimeService
listener
- the listener.public def
removeTimeListener(listener : TimeListener) : void
TimeService
removeTimeListener
in interface TimeService
listener
- the listener.Copyright © 2021 the original authors or authors.