|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.realtime.AsyncEvent | +--javax.realtime.Timer | +--javax.realtime.PeriodicTimer
An AsyncEvent
whose fire method is executed periodically
according to the given parameters. If a clock is given, calculation
of the period uses the increments of the clock. If an interval is
given or set the system guarantees that the fire method will execute
interval
time units after the last execution or its
given start time as appropriate. If one of the
HighResolutionTime
argument types is
RationalTime
then the system guarantees that the fire
method will be executed exactly frequence
times every
unit time by adjusting the interval between executions of
fire()
. This is similar to a thread with
PeriodicParameters
except that it is lighter weight.
If a PeriodicTimer
is disabled, it still counts, and
if enabled at some later time, it will fire at its next scheduled
fire time.
Field Summary | |
private javax.realtime.RelativeTime |
interval
|
Fields inherited from class javax.realtime.Timer |
defaultClock, enabled, fireAfter, handler, lastUpdated, started, timePassed |
Fields inherited from class javax.realtime.AsyncEvent |
handlersList |
Constructor Summary | |
PeriodicTimer(javax.realtime.HighResolutionTime start,
javax.realtime.RelativeTime interval,
javax.realtime.AsyncEventHandler handler)
Create an instance of AsyncEvent that executes its
fire method periodically. |
|
PeriodicTimer(javax.realtime.HighResolutionTime start,
javax.realtime.RelativeTime interval,
javax.realtime.Clock clock,
javax.realtime.AsyncEventHandler handler)
Create an instance of AsyncEvent that executes its
fire method periodically. |
Method Summary | |
javax.realtime.ReleaseParameters |
createReleaseParameters()
Create a ReleaseParameters object with the next
fire time as the start time and the interval of this
as the period. |
void |
fire()
Causes the instance of the superclass AsyncEvent
to occur now. |
javax.realtime.AbsoluteTime |
getFireTime()
Gets the absolute time this will next fire |
javax.realtime.RelativeTime |
getInterval()
Gets the interval of this . |
void |
setInterval(javax.realtime.RelativeTime interval)
Sets the interval value of this . |
Methods inherited from class javax.realtime.Timer |
destroy, disable, enable, getClock, isRunning, reschedule, start, stop |
Methods inherited from class javax.realtime.AsyncEvent |
addHandler, bindTo, handledBy, removeHandler, setHandler, unbindTo |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private javax.realtime.RelativeTime interval
Constructor Detail |
public PeriodicTimer(javax.realtime.HighResolutionTime start, javax.realtime.RelativeTime interval, javax.realtime.AsyncEventHandler handler)
AsyncEvent
that executes its
fire method periodically.
start
- The time when the first interval begins.interval
- The time between successive executions of the fire method.handler
- The instance of AsyncEventHandler
that will be
scheduled each time the fire method is executed.public PeriodicTimer(javax.realtime.HighResolutionTime start, javax.realtime.RelativeTime interval, javax.realtime.Clock clock, javax.realtime.AsyncEventHandler handler)
AsyncEvent
that executes its
fire method periodically.
start
- The time when the first interval begins.interval
- The time between successive executions of the fire method.clock
- The clock whose increments are used to calculate the interval.handler
- The instance of AsyncEventhandler
that will be
scheduled each time the fire method is executed.Method Detail |
public javax.realtime.ReleaseParameters createReleaseParameters()
ReleaseParameters
object with the next
fire time as the start time and the interval of this
as the period.
createReleaseParameters
in class Timer
ReleaseParameters
object.public void fire()
AsyncEvent
to occur now.
fire
in class AsyncEvent
public javax.realtime.AbsoluteTime getFireTime()
this
will next fire
getFireTime
in class Timer
public javax.realtime.RelativeTime getInterval()
this
.
interval
.public void setInterval(javax.realtime.RelativeTime interval)
interval
value of this
.
interval
- The value to which interval
will be set.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |