public class ContinuousClock extends AbstractClock implements IContinuousClock
DEFAULT_DELTA, 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 |
---|
ContinuousClock(IClock oldclock,
IThreadPool threadpool)
Create a new clock.
|
ContinuousClock(String name,
long starttime,
double dilation,
IThreadPool threadpool)
Create a new clock.
|
ContinuousClock(String name,
long starttime,
double dilation,
long delta,
IThreadPool threadpool)
Create a new clock.
|
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(IChangeListener listener)
Add a change listener.
|
void |
addTimer(ITimer timer)
Add a timer.
|
void |
dispose()
Called, when the clock is no longer used.
|
double |
getDilation()
Get the clocks dilation.
|
long |
getTime()
Get the clocks name.
|
String |
getType()
Get the clock type.
|
void |
removeTimer(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.
|
addTickTimer, createTickTimer, createTimer, getDelta, getName, getNextTimer, getStarttime, getState, getTick, getTickTimers, getTimers, removeChangeListener, removeTickTimer, setDelta, shutdown
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addTickTimer, createTickTimer, createTimer, getDelta, getName, getNextTimer, getStarttime, getState, getTick, getTickTimers, getTimers, removeChangeListener, removeTickTimer, setDelta
public ContinuousClock(String name, long starttime, double dilation, IThreadPool threadpool)
name
- The clock name.starttime
- The start time.dilation
- The dilation.public ContinuousClock(String name, long starttime, double dilation, long delta, IThreadPool threadpool)
name
- The clock name.starttime
- The start time.dilation
- The dilation.delta
- The tick size (in millis).public ContinuousClock(IClock oldclock, IThreadPool threadpool)
oldclock
- The old clock.public void dispose()
dispose
in interface IClock
dispose
in class AbstractClock
public long getTime()
getTime
in interface IClock
getTime
in class AbstractClock
public double getDilation()
getDilation
in interface IContinuousClock
public void setDilation(double dilation)
setDilation
in interface IContinuousClock
dilation
- The clocks dilation.public String getType()
public void start()
start
in interface IClock
start
in class AbstractClock
public void stop()
stop
in interface IClock
stop
in class AbstractClock
public void reset()
reset
in interface IClock
reset
in class AbstractClock
public void addTimer(ITimer timer)
addTimer
in interface IClock
addTimer
in class AbstractClock
timer
- The timer.public void removeTimer(ITimer timer)
removeTimer
in interface IClock
removeTimer
in class AbstractClock
timer
- The timer.public void addChangeListener(IChangeListener listener)
addChangeListener
in interface IClock
addChangeListener
in class AbstractClock
listener
- The change listener.Copyright © 2012. All Rights Reserved.