Package jadex.platform.service.clock
Class SystemClock
- java.lang.Object
- 
- jadex.platform.service.clock.AbstractClock
- 
- jadex.platform.service.clock.ContinuousClock
- 
- jadex.platform.service.clock.SystemClock
 
 
 
- 
- All Implemented Interfaces:
- IClock,- IContinuousClock
 
 public class SystemClock extends ContinuousClock Clock implementation that corresponds to the exact system clock.
- 
- 
Field SummaryFields Modifier and Type Field Description protected longstoptimeThe time when the clock was stopped (used to adjust timers before restarting the clock).- 
Fields inherited from class jadex.platform.service.clock.ContinuousClockdilation, elapsed, executor, laststart, threadpool
 - 
Fields inherited from class jadex.platform.service.clock.AbstractClockcurrenttime, DEFAULT_DELTA, delta, listeners, name, starttime, state, ticktimer, ticktimers, timers
 - 
Fields inherited from interface jadex.bridge.service.types.clock.IClockEVENT_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 SummaryConstructors Constructor Description SystemClock(IClock oldclock, IThreadPool threadpool)Create a new clock.SystemClock(java.lang.String name, long delta, IThreadPool threadpool)Create a new clock.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopyFromClock(IClock oldclock)Transfer state from another clock to this clock.doublegetDilation()The dilation is always 1.0.longgetTime()The current time is always the same as the system time.java.lang.StringgetType()Get the type of the clock.voidstop()Stop the clock.- 
Methods inherited from class jadex.platform.service.clock.ContinuousClockaddChangeListener, addTimer, computeNextTimepoint, createExecutor, dispose, removeTimer, reset, setDilation, start
 - 
Methods inherited from class jadex.platform.service.clock.AbstractClockactivateTickTimer, addTickTimer, createTickTimer, createTimer, getDelta, getName, getNextTimer, getStarttime, getState, getTick, getTickTimers, getTimers, hasListeners, notifyListeners, removeChangeListener, removeTickTimer, setDelta, setStarttime, shutdown
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface jadex.bridge.service.types.clock.IClockaddTickTimer, createTickTimer, createTimer, getDelta, getName, getNextTimer, getStarttime, getState, getTick, getTickTimers, getTimers, removeChangeListener, removeTickTimer, setDelta, setStarttime
 
- 
 
- 
- 
- 
Constructor Detail- 
SystemClockpublic SystemClock(IClock oldclock, IThreadPool threadpool) Create a new clock.- Parameters:
- oldclock- The old clock.
 
 - 
SystemClockpublic SystemClock(java.lang.String name, long delta, IThreadPool threadpool)Create a new clock.
 
- 
 - 
Method Detail- 
copyFromClockpublic void copyFromClock(IClock oldclock) Transfer state from another clock to this clock.- Overrides:
- copyFromClockin class- ContinuousClock
 
 - 
getTypepublic java.lang.String getType() Get the type of the clock.- Specified by:
- getTypein interface- IClock
- Overrides:
- getTypein class- ContinuousClock
- Returns:
- The clock type.
 
 - 
getTimepublic long getTime() The current time is always the same as the system time.- Specified by:
- getTimein interface- IClock
- Overrides:
- getTimein class- ContinuousClock
- Returns:
- The name.
 
 - 
getDilationpublic double getDilation() The dilation is always 1.0.- Specified by:
- getDilationin interface- IContinuousClock
- Overrides:
- getDilationin class- ContinuousClock
- Returns:
- The clocks dilation.
 
 - 
stoppublic void stop() Stop the clock.- Specified by:
- stopin interface- IClock
- Overrides:
- stopin class- ContinuousClock
 
 
- 
 
-