net.ctdp.rfdynhud.valuemanagers
Class TimeBasedClock
java.lang.Object
net.ctdp.rfdynhud.valuemanagers.Clock
net.ctdp.rfdynhud.valuemanagers.TimeBasedClock
- All Implemented Interfaces:
- ManagedValue
public class TimeBasedClock
- extends Clock
The TimeBasedClock
calculates frame gaps based on a given time delay to know, when to set the clock flag and when to reset.
- Author:
- Marvin Froehlich (CTDP)
Method Summary |
protected void |
initImpl(long nanoTime)
Implementation specific code for initialization. |
protected boolean |
updateImpl(long nanoTime,
long frameCounter,
boolean force)
Implementation of the update method. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_MIN_FRAMES
public static final long DEFAULT_MIN_FRAMES
- See Also:
- Constant Field Values
TimeBasedClock
public TimeBasedClock(long delay,
long minFrames)
TimeBasedClock
public TimeBasedClock(long delay)
initImpl
protected void initImpl(long nanoTime)
- Implementation specific code for initialization.
- Specified by:
initImpl
in class Clock
- Parameters:
nanoTime
- the starting time stamp
updateImpl
protected boolean updateImpl(long nanoTime,
long frameCounter,
boolean force)
- Implementation of the update method.
- Specified by:
updateImpl
in class Clock
- Parameters:
nanoTime
- the current timestamp in nano secondsframeCounter
- the current frame indexforce
- force clock to true
.
- Returns:
true
to set the Clock
flag to true
.