|
jmce - 1_02 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
jmce.util.TimerManager
public class TimerManager
Timer manager for Timer.
Like java.util.TimerTask but it is possible to change the base time and make timer based on every unit of time. The default implementation is for time milliseconds based. To create a TimerManager in any other time unit the method elapsed() must be called at regular interval with a number of unit time elapsed as parameter.
For performance reason the Timer are inserted in one double linked list managed from the TimerManager itelf. Method are non sincronized so be carefully if used from more than one thread.
Timer
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
TimerManager(java.lang.String name)
Standard constructor |
Method Summary | |
---|---|
void |
add(Timer t)
Add a timer to the queue. |
static void |
addTimer(Timer t)
Add a new timer to the standard timer queue. |
void |
elapsed(int n)
Called to advance the queue |
int |
getSize()
Return the number of timer queued. |
void |
remove(Timer t)
Remove a timer from the queue. |
void |
run()
Thread to manage the standard ms based timer manager. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TimerManager(java.lang.String name)
Method Detail |
---|
public final int getSize()
public static void addTimer(Timer t)
public final void add(Timer t)
public final void remove(Timer t)
public final void elapsed(int n) throws SIMException
SIMException
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public java.lang.String toString()
toString
in class java.lang.Thread
|
jmce - 1_02 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |