|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmaslab.data.Clock
public class Clock
A Clock allows applications to seamlessly interchange live runs with simulated data.
| Constructor Summary | |
|---|---|
Clock()
Produce a started realtime clock. |
|
Clock(double timeDialation)
How fast should time travel? Set to <0 for "fast as possible", 1.0 for real time. |
|
| Method Summary | |
|---|---|
void |
addEventSource(ClockEventSource source)
|
void |
forceRealtime()
Can be called to force timeDialation=1.0 (e.g., realtime). |
java.lang.Thread |
getEventThread()
|
double |
getTime()
Returns zero if the clock has not yet been started. |
double |
getWallTime()
|
void |
sleep(double ms)
must NOT be called from our EventThread |
void |
sleepUntilTime(double time)
|
void |
start()
Starts the clock. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Clock()
public Clock(double timeDialation)
| Method Detail |
|---|
public java.lang.Thread getEventThread()
public void start()
public void addEventSource(ClockEventSource source)
public void forceRealtime()
public double getTime()
public double getWallTime()
public void sleepUntilTime(double time)
public void sleep(double ms)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||