|
Eidola home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eidola.util.ThreadFlock
Creates a collection of threads running the same Runnable
.
The threads have the same priority and the same daemon status.
You can start, interrupt, and join the threads en masse.
Constructor Summary | |
ThreadFlock(Runnable runnable)
Creates a new flock with one thread. |
|
ThreadFlock(Runnable runnable,
int threadCount)
Creates a new flock with an arbitrary number of threads. |
|
ThreadFlock(Thread thread)
Creates a new flock with one thread. |
|
ThreadFlock(Thread thread,
int threadCount)
Creates a new flock with an arbitrary number of threads. |
Method Summary | |
int |
getPriority()
Returns the priority of the threads in this flock. |
int |
getThreadCount()
Returns the number of threads in this flock. |
void |
interrupt()
Interrupts all the threads in the flock. |
boolean |
isDaemon()
Determines whether the threads in this flock are daemons. |
void |
join(long time)
Waits for all the threads in the flock to die. |
void |
setDaemon(boolean daemon)
Changes whether the threads in this flock are daemons. |
void |
setPriority(int priority)
Sets the priority of all the threads in this flock. |
void |
setThreadCount(int threadCount,
boolean start)
Sets the number of threads in this flock. |
void |
start()
Starts all the threads in the flock. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ThreadFlock(Runnable runnable)
start()
.public ThreadFlock(Runnable runnable, int threadCount)
start()
.public ThreadFlock(Thread thread)
start()
.public ThreadFlock(Thread thread, int threadCount)
start()
.Method Detail |
public int getThreadCount()
public void setThreadCount(int threadCount, boolean start)
interrupt
the appropriate number of threads.public int getPriority()
Thread.getPriority()
public void setPriority(int priority)
setThreadCount
.Thread.setPriority(int)
public boolean isDaemon()
Thread.isDaemon()
public void setDaemon(boolean daemon)
setThreadCount
.Thread.setDaemon(boolean)
public void start()
Thread.start()
public void interrupt()
Thread.interrupt()
public void join(long time) throws InterruptedException
Thread.join(long)
|
Eidola home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |