Package jadex.bridge.service.types.clock
Interface IClockService
-
public interface IClockService
The clock service.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SIMULATION_CLOCK_FLAG
Platform value key for flag if the clock is a simulation clock.static java.lang.Class
TYPE
The Class object representing the class corresponding to the this interface.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addChangeListener(IChangeListener listener)
Add a change listener.boolean
advanceEvent()
Advance one event.java.util.TimerTask
createRealtimeTimer(long time, ITimedObject to)
Create a new realtime timer.ITimer
createTickTimer(ITimedObject to)
Create a new tick timer.ITimer
createTimer(long time, ITimedObject to)
Create a new timer.java.lang.String
getClockType()
Get the clock type.long
getDelta()
Get the clock delta.double
getDilation()
Get the clocks dilation.ITimer
getNextTimer()
Get the next timer.long
getStarttime()
Get the clocks start time.java.lang.String
getState()
Get the clock state.double
getTick()
Get the current tick.long
getTime()
Get the current time.ITimer[]
getTimers()
Get all active timers.void
removeChangeListener(IChangeListener listener)
Remove a change listener.void
setClock(java.lang.String type, IThreadPool tp)
Set the clock.void
setDelta(long delta)
Set the clock delta.void
setDilation(double dilation)
Set the clocks dilation.void
start()
Start the clock.void
stop()
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.
-
-