| Modifier and Type | Field and Description |
|---|---|
| private final Runnable | |
| private final Duration | |
| private long | |
| private final Timeline |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Timer | |
| public static Timer | createPeriodic(Duration interval, Runnable action)
Prepares a (stopped) timer that lasts for |
| public static Timer | createPeriodic0(Duration interval, Runnable action)
Prepares a (stopped) timer that lasts for |
| public void | restart()
Implements org. Schedules the associated action to be executed after the associated delay. |
| public static Timer | |
| public static Timer | runPeriodically(Duration interval, Runnable action)
Equivalent to |
| public static Timer | runPeriodically0(Duration interval, Runnable action)
Equivalent to |
| public void | stop()
Implements org. If the associated action has been scheduled for execution but not yet executed, this method prevents it from being executed at all. |
| action | back to summary |
|---|---|
| private final Runnable action | |
| actionTime | back to summary |
|---|---|
| private final Duration actionTime | |
| seq | back to summary |
|---|---|
| private long seq | |
| timeline | back to summary |
|---|---|
| private final Timeline timeline | |
| FxTimer | back to summary |
|---|---|
| private FxTimer(Duration actionTime, Duration period, Runnable action, int cycles) | |
| create | back to summary |
|---|---|
| public static Timer create(Duration delay, Runnable action) Prepares a (stopped) timer that lasts for | |
| createPeriodic | back to summary |
|---|---|
| public static Timer createPeriodic(Duration interval, Runnable action) Prepares a (stopped) timer that lasts for | |
| createPeriodic0 | back to summary |
|---|---|
| public static Timer createPeriodic0(Duration interval, Runnable action) Prepares a (stopped) timer that lasts for | |
| restart | back to summary |
|---|---|
| public void restart() Implements org. Doc from org. Schedules the associated action to be executed after the associated delay. If the action is already scheduled but hasn't been executed yet, the timeout is reset, so that the action won't be executed before the full delay from now.
| |
| runLater | back to summary |
|---|---|
| public static Timer runLater(Duration delay, Runnable action) Equivalent to | |
| runPeriodically | back to summary |
|---|---|
| public static Timer runPeriodically(Duration interval, Runnable action) Equivalent to | |
| runPeriodically0 | back to summary |
|---|---|
| public static Timer runPeriodically0(Duration interval, Runnable action) Equivalent to | |
| stop | back to summary |
|---|---|
| public void stop() Implements org. Doc from org. If the associated action has been scheduled for execution but not yet
executed, this method prevents it from being executed at all. This is
also true in case the timer's timeout has already expired, but the
associated action hasn't had a chance to be executed on the associated
thread. Note that this is a stronger guarantee than the one given by
In contrast, using the FxTimer, the action is guaranteed not to
be executed after stop():
| |