|
Voyager ORB | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.objectspace.lib.timer.Timer
A Timer can deliver a timer event to each of its listeners at a particular point in time or periodically. To conserve thread usage, Timers are managed by TimerGroups. A TimerGroup uses a single thread to manage one or more Timers. If you do not specify a TimerGroup when a Timer is constructed, it is automatically added to a single shared default TimerGroup.
TimerGroup
Constructor Summary | |
Timer()
Construct a timer and add it to the default timer group. |
|
Timer(TimerGroup group)
Construct a timer and add it to the specified timer group. |
Method Summary | |
void |
addTimerListener(TimerListener listener)
Add the specified listener to my list of listeners. |
void |
alarmAfter(long milliseconds)
Generate a timer event after the specified number of milliseconds. |
void |
alarmAt(java.util.Date date)
Generate a timer event at the specified date. |
void |
alarmEvery(long period)
Generate a timer event every time the specified period elapses. |
void |
clearAlarm()
Clear my alarm. |
java.util.Date |
getAlarm()
Return the time of the next timer event. |
long |
getPeriodicity()
Return the number of milliseconds between each timer event or 0 if the timer does not cycle. |
void |
removeTimerListener(TimerListener listener)
Remove the specified listener from my list of listeners. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Timer()
public Timer(TimerGroup group)
group
- The timer group that I should be added to.Method Detail |
public void clearAlarm()
public void alarmAt(java.util.Date date)
date
- The time to generate a timer event.public void alarmAfter(long milliseconds)
milliseconds
- The delay period.public void alarmEvery(long period)
period
- The cycle time.public java.util.Date getAlarm()
public long getPeriodicity()
public void addTimerListener(TimerListener listener)
listener
- The lister to add.public void removeTimerListener(TimerListener listener)
listener
- The lister to remove.
|
ObjectSpace Inc. | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |