|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--org.zaval.util.Timer
This is timer component. The class is used to organize periodic execution for the
registered Runnable interfaces. The class contains getTimer
static method
to get the Timer instance. Using the method you can get shared timer instance or own
(new) timer instance. Shared instance can be used by several consumers.
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Method Summary | |
void |
add(java.lang.Runnable l,
int startIn,
int repeatIn)
Adds the specified runnable interface to be executed in the given time with the specified period. |
void |
clear(java.lang.Runnable l)
Clears tick counter for the specified runnable interface. |
static Timer |
getTimer(boolean b)
Gets a timer instance. |
void |
remove(java.lang.Runnable l)
Removes the specified runnable interface so it no longer to be executed. |
void |
run()
|
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
public void add(java.lang.Runnable l, int startIn, int repeatIn)
l
- the specified runnable interface.startIn
- the specified time (milliseconds) after that the interface will
be executed first.repeatIn
- the specified period (milliseconds) of the runnable interface
execution.public void remove(java.lang.Runnable l)
l
- the specified runnable interface.public void clear(java.lang.Runnable l)
l
- the specified runnable interface.public void run()
run
in class java.lang.Thread
public static Timer getTimer(boolean b)
b
- the specified flag. If the parameter is true
than
a new timer instance will be created otherwise shared timer instance will be returned.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |