- java.lang.Object
-
- swim.concurrent.Clock
-
- swim.concurrent.StageClock
-
-
Field Summary
Fields Modifier and Type Field Description protected StagestageStageon which to execute timer functions.-
Fields inherited from class swim.concurrent.Clock
TICK_COUNT, TICK_MILLIS
-
-
Constructor Summary
Constructors Constructor Description StageClock(Stage stage)Constructs a newStageClockwith a timer resolution ofClock.TICK_MILLISmilliseconds, and a clock period ofClock.TICK_COUNTticks per revolution, that executes timer functions on the givenstage.StageClock(Stage stage, int tickMillis, int tickCount)Constructs a newStageClockwith a timer resolution oftickMillismilliseconds, and a clock period oftickCountticks per revolution, that executes timer functions on the givenstage.StageClock(Stage stage, ClockDef clockDef)Constructs a newStageClock, with the timer resolution and clock period specified by the givenclockDef, that executes timer functions on the givenstage.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidrunTimer(TimerFunction timer, Runnable runnable)Stagestage()Returns the stage on which to execute timer functions.-
Methods inherited from class swim.concurrent.Clock
didFail, didStart, didStop, didTick, nanoTime, setTimer, sleep, start, stop, tick, timer, timerDidCancel, timerDidFail, timerDidRun, timerWillRun, timerWillSchedule, willStart, willStop
-
-
-
-
Field Detail
-
stage
protected final Stage stage
Stageon which to execute timer functions.
-
-
Constructor Detail
-
StageClock
public StageClock(Stage stage, int tickMillis, int tickCount)
Constructs a newStageClockwith a timer resolution oftickMillismilliseconds, and a clock period oftickCountticks per revolution, that executes timer functions on the givenstage.
-
StageClock
public StageClock(Stage stage, ClockDef clockDef)
Constructs a newStageClock, with the timer resolution and clock period specified by the givenclockDef, that executes timer functions on the givenstage.
-
StageClock
public StageClock(Stage stage)
Constructs a newStageClockwith a timer resolution ofClock.TICK_MILLISmilliseconds, and a clock period ofClock.TICK_COUNTticks per revolution, that executes timer functions on the givenstage.
-
-
Method Detail
-
stage
public final Stage stage()
Returns the stage on which to execute timer functions.
-
runTimer
protected void runTimer(TimerFunction timer, Runnable runnable)
-
-