public class ContinuousClock extends AbstractClock implements IContinuousClock
| Modifier and Type | Field and Description |
|---|---|
protected double |
dilation
The dilation.
|
protected long |
elapsed
The elapsed time.
|
protected jadex.commons.concurrent.Executor |
executor
The active timer watcher.
|
protected long |
laststart
The last starting real time measurement point.
|
protected jadex.commons.concurrent.IThreadPool |
threadpool
The threadpool.
|
currenttime, DEFAULT_DELTA, delta, listeners, name, starttime, state, ticktimer, ticktimers, timersEVENT_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 |
|---|
ContinuousClock(jadex.bridge.service.types.clock.IClock oldclock,
jadex.commons.concurrent.IThreadPool threadpool)
Create a new clock.
|
ContinuousClock(java.lang.String name,
long starttime,
double dilation,
jadex.commons.concurrent.IThreadPool threadpool)
Create a new clock.
|
ContinuousClock(java.lang.String name,
long starttime,
double dilation,
long delta,
jadex.commons.concurrent.IThreadPool threadpool)
Create a new clock.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addChangeListener(jadex.commons.IChangeListener listener)
Add a change listener.
|
void |
addTimer(jadex.bridge.service.types.clock.ITimer timer)
Add a timer.
|
protected void |
computeNextTimepoint()
Compute the next timepoint.
|
protected void |
copyFromClock(jadex.bridge.service.types.clock.IClock oldclock)
Transfer state from another clock to this clock.
|
protected jadex.commons.concurrent.Executor |
createExecutor()
Create new executor.
|
void |
dispose()
Called, when the clock is no longer used.
|
double |
getDilation()
Get the clocks dilation.
|
long |
getTime()
Get the clocks name.
|
java.lang.String |
getType()
Get the clock type.
|
void |
removeTimer(jadex.bridge.service.types.clock.ITimer timer)
Remove a timer.
|
void |
reset()
Reset the clock.
|
void |
setDilation(double dilation)
Set the clocks dilation.
|
void |
start()
Start the clock.
|
void |
stop()
Stop the clock.
|
activateTickTimer, addTickTimer, createTickTimer, createTimer, getDelta, getName, getNextTimer, getStarttime, getState, getTick, getTickTimers, getTimers, hasListeners, notifyListeners, removeChangeListener, removeTickTimer, setDelta, setStarttime, shutdownprotected double dilation
protected long laststart
protected long elapsed
protected jadex.commons.concurrent.Executor executor
protected jadex.commons.concurrent.IThreadPool threadpool
public ContinuousClock(java.lang.String name,
long starttime,
double dilation,
jadex.commons.concurrent.IThreadPool threadpool)
name - The clock name.starttime - The start time.dilation - The dilation.public ContinuousClock(java.lang.String name,
long starttime,
double dilation,
long delta,
jadex.commons.concurrent.IThreadPool threadpool)
name - The clock name.starttime - The start time.dilation - The dilation.delta - The tick size (in millis).public ContinuousClock(jadex.bridge.service.types.clock.IClock oldclock,
jadex.commons.concurrent.IThreadPool threadpool)
oldclock - The old clock.protected void copyFromClock(jadex.bridge.service.types.clock.IClock oldclock)
copyFromClock in class AbstractClockpublic void dispose()
dispose in interface jadex.bridge.service.types.clock.IClockdispose in class AbstractClockpublic long getTime()
getTime in interface jadex.bridge.service.types.clock.IClockgetTime in class AbstractClockpublic double getDilation()
getDilation in interface IContinuousClockpublic void setDilation(double dilation)
setDilation in interface IContinuousClockdilation - The clocks dilation.public java.lang.String getType()
getType in interface jadex.bridge.service.types.clock.IClockpublic void start()
start in interface jadex.bridge.service.types.clock.IClockstart in class AbstractClockpublic void stop()
stop in interface jadex.bridge.service.types.clock.IClockstop in class AbstractClockpublic void reset()
reset in interface jadex.bridge.service.types.clock.IClockreset in class AbstractClockprotected void computeNextTimepoint()
public void addTimer(jadex.bridge.service.types.clock.ITimer timer)
addTimer in interface jadex.bridge.service.types.clock.IClockaddTimer in class AbstractClocktimer - The timer.public void removeTimer(jadex.bridge.service.types.clock.ITimer timer)
removeTimer in interface jadex.bridge.service.types.clock.IClockremoveTimer in class AbstractClocktimer - The timer.public void addChangeListener(jadex.commons.IChangeListener listener)
addChangeListener in interface jadex.bridge.service.types.clock.IClockaddChangeListener in class AbstractClocklistener - The change listener.protected jadex.commons.concurrent.Executor createExecutor()