javax.realtime
Class OneShotTimer
java.lang.Object
|
+--javax.realtime.AsyncEvent
|
+--javax.realtime.Timer
|
+--javax.realtime.OneShotTimer
- public class OneShotTimer
- extends Timer
A timed AsyncEvent
that is driven by a clock. It will
fire off once, when the clock time reaches the timeout time. If the
clock time has already passed the timeout time, it will fire
immediately.
Constructor Summary |
OneShotTimer(javax.realtime.HighResolutionTime time,
javax.realtime.AsyncEventHandler handler)
Create an instance of AsyncEvent that will execute
its fire method at the expiration of the given time. |
OneShotTimer(javax.realtime.HighResolutionTime start,
javax.realtime.Clock clock,
javax.realtime.AsyncEventHandler handler)
Create an instance of AsyncEvent , based on the
given clock, that will execute its fire method at the expiration
of the given time. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OneShotTimer
public OneShotTimer(javax.realtime.HighResolutionTime time,
javax.realtime.AsyncEventHandler handler)
- Create an instance of
AsyncEvent
that will execute
its fire method at the expiration of the given time.
- Parameters:
time
- After timeout time
units from 'now'
fire will be executed.handler
- The AsyncEventHandler
that will be
scheduled when fire is executed.
OneShotTimer
public OneShotTimer(javax.realtime.HighResolutionTime start,
javax.realtime.Clock clock,
javax.realtime.AsyncEventHandler handler)
- Create an instance of
AsyncEvent
, based on the
given clock, that will execute its fire method at the expiration
of the given time.
- Parameters:
start
- Start time for timer.clock
- The timer will increment based on this clock.handler
- The AsyncEventHandler
that will be
scheduled when fire is executed.