|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectunsw.cse.mica.tools.timer.Timer
public class Timer
The Timer class provides the functionality for an agent that can provides events at specific times. Normally it is wrapped inside a TimerAgent to provide an agent capable of processing event request mobs and generating new mobs as events fire. As there are times when atighter coupling is needed between an agent and the timing functionality, the core functionality is kept separate from the TimerAgent interface. An example of this is in the TimerMicaBot, which uses its own internal timer to provide temporal functionality within FrameScript.
Constructor Summary | |
---|---|
Timer(ITimerHandler handler)
Create a new timer with the given handler |
Method Summary | |
---|---|
void |
addEvent(TimerEvent event)
Add the given event to the event list |
void |
cancelAllEvents()
Cancel all the events currently in the queue. |
void |
cancelEvents(java.util.List names)
Cancel all the events whose names are in the list given |
void |
init()
Initialise the timer by starting the internal thread. |
void |
run()
The main loop for the internal thread. |
void |
terminate()
Terminate the timer. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Timer(ITimerHandler handler)
handler
- Method Detail |
---|
public void init()
public void terminate()
public void cancelAllEvents()
public void cancelEvents(java.util.List names)
names
- a list assumed to contain Strings, representing the names of the events
that are to be cancelled.public void addEvent(TimerEvent event)
event
- public void run()
run
in interface java.lang.Runnable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |