Package jadex.bridge.service.types.clock
Interface IClockService
-
public interface IClockServiceThe clock service.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSIMULATION_CLOCK_FLAGPlatform value key for flag if the clock is a simulation clock.static java.lang.ClassTYPEThe Class object representing the class corresponding to the this interface.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddChangeListener(IChangeListener listener)Add a change listener.booleanadvanceEvent()Advance one event.java.util.TimerTaskcreateRealtimeTimer(long time, ITimedObject to)Create a new realtime timer.ITimercreateTickTimer(ITimedObject to)Create a new tick timer.ITimercreateTimer(long time, ITimedObject to)Create a new timer.java.lang.StringgetClockType()Get the clock type.longgetDelta()Get the clock delta.doublegetDilation()Get the clocks dilation.ITimergetNextTimer()Get the next timer.longgetStarttime()Get the clocks start time.java.lang.StringgetState()Get the clock state.doublegetTick()Get the current tick.longgetTime()Get the current time.ITimer[]getTimers()Get all active timers.voidremoveChangeListener(IChangeListener listener)Remove a change listener.voidsetClock(java.lang.String type, IThreadPool tp)Set the clock.voidsetDelta(long delta)Set the clock delta.voidsetDilation(double dilation)Set the clocks dilation.voidstart()Start the clock.voidstop()Stop the clock.
-
-
-
Field Detail
-
SIMULATION_CLOCK_FLAG
static final java.lang.String SIMULATION_CLOCK_FLAG
Platform value key for flag if the clock is a simulation clock.- See Also:
- Constant Field Values
-
TYPE
static final java.lang.Class TYPE
The Class object representing the class corresponding to the this interface. Need due to JavaFlow Bug: http://issues.apache.org/jira/browse/SANDBOX-111
-
-
Method Detail
-
getTime
long getTime()
Get the current time.- Returns:
- The current time.
-
getTick
double getTick()
Get the current tick.- Returns:
- The current tick.
-
getStarttime
long getStarttime()
Get the clocks start time.- Returns:
- The start time.
-
getDelta
long getDelta()
Get the clock delta.- Returns:
- The clock delta.
-
getState
java.lang.String getState()
Get the clock state.- Returns:
- The clock state.
-
setDelta
void setDelta(long delta)
Set the clock delta.- Parameters:
delta- The new clock delta.
-
getDilation
double getDilation()
Get the clocks dilation.- Returns:
- The clocks dilation. // Hack. Remove? only for continuous
-
setDilation
void setDilation(double dilation)
Set the clocks dilation.- Parameters:
dilation- The clocks dilation. // Hack. Remove? only for continuous
-
start
void start()
Start the clock.
-
stop
void stop()
Stop the clock.
-
createTimer
ITimer createTimer(long time, ITimedObject to)
Create a new timer. The unit of the timespan value depends on the clock implementation. For system clocks, the time value should adhere to the time representation as used bySystem.currentTimeMillis().- Parameters:
timespan- The relative timespan after which the timed object should be notified.to- The timed object.
-
createTickTimer
ITimer createTickTimer(ITimedObject to)
Create a new tick timer. todo: @param tickcount The number of ticks.- Parameters:
to- The timed object.
-
createRealtimeTimer
java.util.TimerTask createRealtimeTimer(long time, ITimedObject to)Create a new realtime timer.- Parameters:
timespan- The relative timespan after which the timed object should be notified.to- The timed object.
-
getNextTimer
ITimer getNextTimer()
Get the next timer.- Returns:
- The next timer.
-
getTimers
ITimer[] getTimers()
Get all active timers.- Returns:
- The active timers.
-
addChangeListener
void addChangeListener(IChangeListener listener)
Add a change listener.- Parameters:
listener- The change listener.
-
removeChangeListener
void removeChangeListener(IChangeListener listener)
Remove a change listener.- Parameters:
listener- The change listener.
-
getClockType
java.lang.String getClockType()
Get the clock type.- Returns:
- The clock type.
-
advanceEvent
boolean advanceEvent()
Advance one event.- Returns:
- True, if clock could be advanced.
-
setClock
void setClock(java.lang.String type, IThreadPool tp)Set the clock.- Parameters:
clock- The new clock.
-
-