public class OneShotTimer extends Timer
This event will fire once at a specified time.
| Constructor and Description |
|---|
OneShotTimer(HighResolutionTime<?> time,
AsyncBaseEventHandler handler)
Constructor to create an instance with given time and handler.
|
OneShotTimer(HighResolutionTime<?> time,
AsyncEventHandler handler)
Constructor to create an instance with given time and handler.
|
OneShotTimer(HighResolutionTime<?> time,
AsyncEventHandler handler,
TimeDispatcher dispatcher)
Creates an instance of
OneShotTimer, based on the given
clock, that will execute its fire method
according to the given time. |
OneShotTimer(HighResolutionTime<?> start,
Clock clock,
AsyncBaseEventHandler handler)
Constructor to create an instance with given time, clock and
handler.
|
OneShotTimer(HighResolutionTime<?> start,
Clock clock,
AsyncEventHandler handler)
Constructor to create an instance with given time, clock and
handler.
|
bindTo, createReleaseParameters, destroy, finalize, fire, getClock, getDispatcher, getEffectiveStartTime, getEffectiveStartTime, getFireTime, getFireTime, getStart, isActive, isRunning, reschedule, setDispatcher, setStartTime, start, start, start, start, stopaddHandler, handledBy, removeHandler, setHandler, unbindToaddHandler, disable, enable, handledBy, hasHandlers, removeHandler, setHandlerclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdisable, enablepublic OneShotTimer(HighResolutionTime<?> time, AsyncBaseEventHandler handler)
time - The time when this timer should fire. May be null, in
this case this is equal to new RelativeTime(0, 0) and the firing
will occur immediately after a call to start().handler - The handler that will be released when this timer
fires. May be null to have no handler until one will be added via
addHandler.StaticIllegalArgumentException - if time is a negative
RelativeTime.public OneShotTimer(HighResolutionTime<?> time, AsyncEventHandler handler)
This method has been replaced in RTSJ 2.0 to support the more generic AsyncBaseEventHandler and is kept for binary compatibility.
public OneShotTimer(HighResolutionTime<?> start, Clock clock, AsyncBaseEventHandler handler)
start - The time when this timer should fire. May be null, in
this case this is equal to new RelativeTime(0, 0) and the firing
will occur immediately after a call to start().clock - the clock this timer should be based upon. May be
null to use the default System.getRealtimeClock().handler - The handler that will be released when this timer
fires. May be null to have no handler until one will be added via
addHandler.StaticIllegalArgumentException - if time is a negative
RelativeTime.public OneShotTimer(HighResolutionTime<?> time, AsyncEventHandler handler, TimeDispatcher dispatcher) throws StaticIllegalArgumentException, StaticUnsupportedOperationException, IllegalAssignmentError
OneShotTimer, based on the given
clock, that will execute its fire method
according to the given time. The Clock association of
the parameter time is ignored.time - The time used to determine when to fire the event.
A time value of null is equivalent to a
RelativeTime of 0, and in this case the
Timer fires immediately upon a call to start().handler - The default handler to use for this event.
When null, no handler is associated with the
timer and nothing will happen when this event fires unless a
handler is subsequently associated with the timer
using the addHandler() or setHandler() method.dispatcher - The dispatcher used to interface between
this timer and its associated clock. When
null, the system default dispatcher is used.StaticIllegalArgumentException - when time is a
RelativeTime instance less than zero.StaticUnsupportedOperationException - when the Chronograph
associated with time is not a Clock.IllegalAssignmentError - when this OneShotTimer
cannot hold references to time, handler,
or clock.public OneShotTimer(HighResolutionTime<?> start, Clock clock, AsyncEventHandler handler)
This method has been replaced in RTSJ 2.0 to support the more generic AsyncBaseEventHandler and is kept for binary compatibility.
aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2024 aicas GmbH. All Rights Reserved.