|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--com.javageeks.thread.PeriodicThread
PeriodicThread is a specific type of Thread that fires off its
associated Runnable evry interval
milliseconds.
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
PeriodicThread(java.lang.Runnable r,
int interval)
Constructor taking the Runnable whose run method
we wish to call every interval milliseconds. |
Method Summary | |
int |
getInterval()
|
static void |
main(java.lang.String[] args)
Test driver for the PeriodicThread component |
void |
run()
The run method spins in an infinite loop, calling
run on the owned Runnable instance every interval
milliseconds (as specified in the constructor). |
void |
setInterval(int interval)
|
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 |
Constructor Detail |
public PeriodicThread(java.lang.Runnable r, int interval)
run
method
we wish to call every interval
milliseconds.Method Detail |
public int getInterval()
public void setInterval(int interval)
public void run()
run
method spins in an infinite loop, calling
run on the owned Runnable instance every interval
milliseconds (as specified in the constructor). The time spent
in the Runnable's run
method is not taken into
account in the period spent sleeping.run
in class java.lang.Thread
public static void main(java.lang.String[] args) throws java.lang.Exception
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |