|
JSR-927 (Maintenance Release) | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.tv.util.TVTimer
A class representing a timer.
A timer is responsible for managing a set of timer events specified
by timer specifications. When the timer event should be sent,
the timer calls the timer specification's
notifyListeners()
method.
TVTimerSpec
Constructor Summary | |
TVTimer()
Constructs a TVTimer object. |
Method Summary | |
abstract void |
deschedule(TVTimerSpec t)
Removes a timer specification from the set of monitored specifications. |
abstract long |
getGranularity()
Report the granularity of this timer, i.e., the length of time between "ticks" of this timer. |
abstract long |
getMinRepeatInterval()
Report the minimum interval that this timer can repeat tasks. |
static TVTimer |
getTimer()
Returns the default timer for the system. |
abstract TVTimerSpec |
scheduleTimerSpec(TVTimerSpec t)
Begins monitoring a TVTimerSpec. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TVTimer()
Method Detail |
public static TVTimer getTimer()
getTimer()
, or some other platform dependent
implementation.
public abstract TVTimerSpec scheduleTimerSpec(TVTimerSpec t) throws TVTimerScheduleFailedException
When the timer specification should go off, the timer will
call TVTimerSpec.notifyListeners().
Returns the actual TVTimerSpec
that got
scheduled. If you schedule a specification that implies a
smaller granularity than this timer can provide, or a repeat
timer specification that has a smaller repeating interval than
this timer can provide, the timer should round to the closest
value and return that value as a TVTimerSpec
object. An
interested application can use accessor methods getMinRepeatInterval()
and getGranularity()
to obtain
the Timer's best knowledge of the Timer's limitation on
granularity and repeat interval.
If you schedule an absolute specification that should have gone off already, it will be scheduled to go off immediately, and the return value of this method will be an absolute specification reflecting the current time. The actual listener notification may happen asynchronously.
If the scheduled specification cannot be
satisfied, the exception TVTimerScheduleFailedException
should be thrown.
You may schedule a timer specification with multiple timers. You may schedule a timer specification with the same timer multiple times (in which case it will go off multiple times). If you modify a timer specification after it has been scheduled with any timer, the results are unspecified.
Note: The specified TimerSpec
object may
be modified by this method, e.g., a delayed TimerSpec
may be transformed into an absolute TimerSpec
.
t
- The timer specification to begin monitoring.
TVTimerScheduleFailedException
- is thrown when the scheduled
specification cannot be satisfied.public abstract void deschedule(TVTimerSpec t)
The specified TVTimerSpec
instance t
must
be an instance previously passed into the method
scheduleTimerSpec
on the same instance of TVTimer
.
If it is not, no action is performed.
t
- The timer specification to end monitoring.public abstract long getMinRepeatInterval()
public abstract long getGranularity()
|
JSR-927 (Maintenance Release) | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |