Package org.polyfrost.polyui.utils
Class Clock.FixedTimeExecutor
-
- All Implemented Interfaces:
public final class Clock.FixedTimeExecutor extends Clock.Executor
Create a new FixedTimeExecutor.
- Since:
0.18.1
-
-
Constructor Summary
Constructors Constructor Description Clock.FixedTimeExecutor(Long executeEveryNanos, Integer repeats, Function0<Unit> func)Clock.FixedTimeExecutor(Long executeEveryNanos, Function0<Unit> func)
-
Method Summary
Modifier and Type Method Description final IntegergetCycles()amount of times this has executed. BooleangetFinished()final IntegergetRepeats()Booleantick(Long deltaTimeNanos)Update this Executor, and execute it if the given amount of time has passed. -
-
Method Detail
-
getCycles
final Integer getCycles()
amount of times this has executed. Only incremented when repeats is not 0 (i.e. it does not last forever) to prevent numerical overflow and keep method short.
-
getFinished
Boolean getFinished()
-
getRepeats
final Integer getRepeats()
-
-
-
-