|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.pogamut.experiments.Timer
public class Timer
Timer used for scheduling events in experiments. Execution of this timer could be paused. Some of this code was copied from java.util.Timer;
Nested Class Summary | |
---|---|
(package private) class |
Timer.TimerThread
|
Field Summary | |
---|---|
protected Timer.TimerThread |
executionThread
|
protected java.util.PriorityQueue<TimerTask> |
queue
Queue of tasks. |
private java.lang.Object |
threadReaper
This object causes the timer's task execution thread to exit gracefully when there are no live references to the Timer object and no tasks in the timer queue. |
protected TimeProvider |
timeProvider
|
Constructor Summary | |
---|---|
Timer(Experiment experiment)
Creates a new instance of Timer and starts it. |
Method Summary | |
---|---|
void |
schedule(TimerTask task,
long delay)
Schedules task for execution. |
void |
stopTimer()
Stops timer thread, no other tasks can be scheduled after calling this method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.util.PriorityQueue<TimerTask> queue
private java.lang.Object threadReaper
protected Timer.TimerThread executionThread
protected TimeProvider timeProvider
Constructor Detail |
---|
public Timer(Experiment experiment)
Method Detail |
---|
public void schedule(TimerTask task, long delay)
public void stopTimer()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |