Package org.jgrapes.core
Class Components.Timer
java.lang.Object
org.jgrapes.core.Components.Timer
- Enclosing class:
Components
Represents a timer as created by
Components.schedule(TimeoutHandler, Instant)
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Cancels this timer.void
reschedule
(Duration scheduledFor) Reschedules the timer for the given duration after now.void
reschedule
(Instant scheduledFor) Reschedules the timer for the given instant.Returns the instant that this handler is scheduled for.Returns the timeout handler of this timer.
-
Method Details
-
reschedule
Reschedules the timer for the given instant.- Parameters:
scheduledFor
- the instant
-
reschedule
Reschedules the timer for the given duration after now.- Parameters:
scheduledFor
- the timeout
-
timeoutHandler
Returns the timeout handler of this timer.- Returns:
- the handler
-
scheduledFor
Returns the instant that this handler is scheduled for.- Returns:
- the instant or
null
if the timer has been cancelled.
-
cancel
Cancels this timer.
-