public class SystemClock extends ContinuousClock
Modifier and Type | Field and Description |
---|---|
protected long |
stoptime
The time when the clock was stopped (used to adjust timers before restarting the clock).
|
dilation, elapsed, executor, laststart, threadpool
currenttime, DEFAULT_DELTA, delta, listeners, name, starttime, state, ticktimer, ticktimers, timers
EVENT_TYPE_NEW_DELTA, EVENT_TYPE_NEW_DILATION, EVENT_TYPE_NEXT_TIMEPOINT, EVENT_TYPE_RESET, EVENT_TYPE_STARTED, EVENT_TYPE_STOPPED, EVENT_TYPE_TIMER_ADDED, EVENT_TYPE_TIMER_REMOVED, STATE_RUNNING, STATE_SUSPENDED, TYPE_CONTINUOUS, TYPE_EVENT_DRIVEN, TYPE_SYSTEM, TYPE_TIME_DRIVEN
Constructor and Description |
---|
SystemClock(jadex.bridge.service.types.clock.IClock oldclock,
jadex.commons.concurrent.IThreadPool threadpool)
Create a new clock.
|
SystemClock(java.lang.String name,
long delta,
jadex.commons.concurrent.IThreadPool threadpool)
Create a new clock.
|
Modifier and Type | Method and Description |
---|---|
protected void |
copyFromClock(jadex.bridge.service.types.clock.IClock oldclock)
Transfer state from another clock to this clock.
|
double |
getDilation()
The dilation is always 1.0.
|
long |
getTime()
The current time is always the same as the system time.
|
java.lang.String |
getType()
Get the type of the clock.
|
void |
stop()
Stop the clock.
|
addChangeListener, addTimer, computeNextTimepoint, createExecutor, dispose, removeTimer, reset, setDilation, start
activateTickTimer, addTickTimer, createTickTimer, createTimer, getDelta, getName, getNextTimer, getStarttime, getState, getTick, getTickTimers, getTimers, hasListeners, notifyListeners, removeChangeListener, removeTickTimer, setDelta, setStarttime, shutdown
protected long stoptime
public SystemClock(jadex.bridge.service.types.clock.IClock oldclock, jadex.commons.concurrent.IThreadPool threadpool)
oldclock
- The old clock.public SystemClock(java.lang.String name, long delta, jadex.commons.concurrent.IThreadPool threadpool)
protected void copyFromClock(jadex.bridge.service.types.clock.IClock oldclock)
copyFromClock
in class ContinuousClock
public java.lang.String getType()
getType
in interface jadex.bridge.service.types.clock.IClock
getType
in class ContinuousClock
public long getTime()
getTime
in interface jadex.bridge.service.types.clock.IClock
getTime
in class ContinuousClock
public double getDilation()
getDilation
in interface IContinuousClock
getDilation
in class ContinuousClock
public void stop()
stop
in interface jadex.bridge.service.types.clock.IClock
stop
in class ContinuousClock