public class PeriodicTimer extends Timer
This timer event fires periodically.
| Constructor and Description |
|---|
PeriodicTimer(HighResolutionTime<?> start,
RelativeTime interval,
AsyncBaseEventHandler handler)
Constructor to create an instance with given time, interval and
handler.
|
PeriodicTimer(HighResolutionTime<?> start,
RelativeTime interval,
AsyncEventHandler handler)
Constructor to create an instance with given time, interval and
handler.
|
PeriodicTimer(HighResolutionTime<?> start,
RelativeTime interval,
Clock clock,
AsyncBaseEventHandler handler)
Constructor to create an instance with given time, interval,
clock and handler.
|
PeriodicTimer(HighResolutionTime<?> start,
RelativeTime interval,
Clock clock,
AsyncEventHandler handler)
Constructor to create an instance with given time, interval,
clock and handler.
|
| Modifier and Type | Method and Description |
|---|---|
ReleaseParameters<?> |
createReleaseParameters()
createReleaseParameters creates the default release
parameters for this event.
|
AbsoluteTime |
getFireTime()
getFireTime returns the time at which this timer is expected to
fire or skip firing (because it is disabled) next.
|
RelativeTime |
getInterval()
getInterval returns the interval of this periodic timer.
|
PeriodicTimer |
setInterval(RelativeTime newinterval)
setInterval changes the interval for this periodic timer.
|
bindTo, destroy, disable, enable, finalize, fire, getClock, getDispatcher, getFireTime, isActive, isRunning, reschedule, start, start, stopaddHandler, handledBy, removeHandler, setHandler, unbindToaddHandler, handledBy, hasHandlers, removeHandler, setHandlerpublic PeriodicTimer(HighResolutionTime<?> start, RelativeTime interval, AsyncBaseEventHandler handler)
start - The time when this timer should fire first. 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().interval - The interval or null to get a behavior like
OneShotTimer.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 or interval is a
negative RelativeTime.public PeriodicTimer(HighResolutionTime<?> start, RelativeTime interval, AsyncEventHandler handler)
This method has been replaced in RTSJ 2.0 to support the more generic AsyncBaseEventHandler and is kept for binary compatibility.
public PeriodicTimer(HighResolutionTime<?> start, RelativeTime interval, Clock clock, AsyncBaseEventHandler handler)
start - The time when this timer should fire first. 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().interval - The interval or null to get a behavior like
OneShotTimer.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 or interval is a
negative RelativeTime.public PeriodicTimer(HighResolutionTime<?> start, RelativeTime interval, 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.
public ReleaseParameters<?> createReleaseParameters()
createReleaseParameters in class TimerStaticIllegalStateException - if this timer is destroyed.public AbsoluteTime getFireTime()
getFireTime in class TimerStaticIllegalStateException - if this timer has been destroyed.public RelativeTime getInterval()
StaticIllegalStateException - if this timer has been destroyed.public PeriodicTimer setInterval(RelativeTime newinterval)
newinterval - the new interval.StaticIllegalArgumentException - if time or interval is a
negative RelativeTime.aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2021 aicas GmbH. All Rights Reserved.