public class ContinuousClock extends AbstractClock implements IContinuousClock
DEFAULT_DELTA, 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(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, shutdownequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddTickTimer, createTickTimer, createTimer, getDelta, getName, getNextTimer, getStarttime, getState, getTick, getTickTimers, getTimers, removeChangeListener, removeTickTimer, setDeltapublic 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 IClockdispose in class AbstractClockpublic long getTime()
getTime in interface IClockgetTime in class AbstractClockpublic double getDilation()
getDilation in interface IContinuousClockpublic void setDilation(double dilation)
setDilation in interface IContinuousClockdilation - The clocks dilation.public String getType()
public void start()
start in interface IClockstart in class AbstractClockpublic void stop()
stop in interface IClockstop in class AbstractClockpublic void reset()
reset in interface IClockreset in class AbstractClockpublic void addTimer(ITimer timer)
addTimer in interface IClockaddTimer in class AbstractClocktimer - The timer.public void removeTimer(ITimer timer)
removeTimer in interface IClockremoveTimer in class AbstractClocktimer - The timer.public void addChangeListener(IChangeListener listener)
addChangeListener in interface IClockaddChangeListener in class AbstractClocklistener - The change listener.Copyright © 2012. All Rights Reserved.