Class SimpleVirtualClock
- java.lang.Object
-
- deltix.qsrv.hf.tickdb.ui.tbshell.virtualplayer.SimpleVirtualClock
-
- All Implemented Interfaces:
deltix.qsrv.hf.pub.TimeSource
public class SimpleVirtualClock extends java.lang.Object implements deltix.qsrv.hf.pub.TimeSource
Implements virtual clock that may run with specified speed and from specified virtual time. Speed may be changed dynamically. Clock may be paused.
-
-
Constructor Summary
Constructors Constructor Description SimpleVirtualClock(double speed, deltix.qsrv.hf.pub.TimeSource baseTimeSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
currentTimeMillis()
double
getSpeed()
long
getVirtualTimeFromRealTime(long currentRealTime)
boolean
isPaused()
boolean
isTimeRunning()
boolean
pause()
void
resetTo(long startingVirtualTimestamp)
Sets current virtual clock time to a specific timestamp.boolean
resume()
void
setSpeed(double speed)
-
-
-
Method Detail
-
currentTimeMillis
public long currentTimeMillis()
- Specified by:
currentTimeMillis
in interfacedeltix.qsrv.hf.pub.TimeSource
- Returns:
- current virtual time
-
getVirtualTimeFromRealTime
public long getVirtualTimeFromRealTime(long currentRealTime)
-
resetTo
public void resetTo(long startingVirtualTimestamp)
Sets current virtual clock time to a specific timestamp.
-
setSpeed
public void setSpeed(double speed)
-
pause
public boolean pause()
-
resume
public boolean resume()
-
isPaused
public boolean isPaused()
-
getSpeed
public double getSpeed()
- Returns:
- configured speed (may be non 0 even if paused)
-
isTimeRunning
public boolean isTimeRunning()
- Returns:
- true if clock is not stopped (due to pause or zero speed)
-
-