|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.realtime.AsyncEvent
javax.realtime.Timer
javax.realtime.PeriodicTimer
An AsynchEvent
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
frequency times every
time unit (see RationalTime
constructors)
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 time.
Field Summary | |
protected RelativeTime |
interval
The interval of this PeriodicTimer |
Fields inherited from class javax.realtime.Timer |
clock, time |
Fields inherited from class javax.realtime.AsyncEvent |
handlers |
Constructor Summary | |
PeriodicTimer(HighResolutionTime start,
RelativeTime interval,
AsyncEventHandler handler)
Create an instance of AsynchEvent that
executes its fire() method periodically. |
|
PeriodicTimer(HighResolutionTime start,
RelativeTime interval,
Clock clock,
AsyncEventHandler handler)
Create an instance of AsynchEvent
that executes its fire() method periodically. |
Method Summary | |
ReleaseParameters |
createReleaseParameters()
Create a ReleaseParameters object
with the next fire time as the start time and the interval of this as the period. |
AbsoluteTime |
getFireTime()
Get the time at which this event will fire. |
RelativeTime |
getInterval()
Return the interval of this Timer . |
void |
setInterval(RelativeTime interval)
Reset the interval of this Timer |
Methods inherited from class javax.realtime.Timer |
destroy, disable, enable, getClock, isRunning, reschedule, start, stop |
Methods inherited from class javax.realtime.AsyncEvent |
addHandler, bindTo, fire, handledBy, removeHandler, setHandler, unbindTo |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected RelativeTime interval
PeriodicTimer
Constructor Detail |
public PeriodicTimer(HighResolutionTime start, RelativeTime interval, AsyncEventHandler handler)
AsynchEvent
that
executes its fire()
method periodically.
start
- the time when the first interval beginsinterval
- the time between successive executions of the fire()
methodhandler
- the instance of
AsynchEventHandler
that will be
scheduled each time the fire event method is executed.public PeriodicTimer(HighResolutionTime start, RelativeTime interval, Clock clock, AsyncEventHandler handler)
AsynchEvent
that executes its fire()
method periodically.
start
- the time when the first interval beginsinterval
- the time between successive executions of the fire()
methodclock
- the clock whose increments are used to calculate the intervalhandler
- the instance of
AsynchEventHandler
that will be
scheduled each time the fire()
method is executed.Method Detail |
public 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
objectpublic AbsoluteTime getFireTime()
Timer
Not currently implemented
getFireTime
in class Timer
Not currently implemented
public RelativeTime getInterval()
Timer
.
RelativeTime
object which
is the current interval of this.public void setInterval(RelativeTime interval)
Timer
interval
- a RelativeTime
object
which is the interval to reset this Timer
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |