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.TimeSourceImplements 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 longcurrentTimeMillis()doublegetSpeed()longgetVirtualTimeFromRealTime(long currentRealTime)booleanisPaused()booleanisTimeRunning()booleanpause()voidresetTo(long startingVirtualTimestamp)Sets current virtual clock time to a specific timestamp.booleanresume()voidsetSpeed(double speed)
-
-
-
Method Detail
-
currentTimeMillis
public long currentTimeMillis()
- Specified by:
currentTimeMillisin 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)
-
-