|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.netseeker.ejoe.concurrent.ThreadQueue
public class ThreadQueue
Constructor Summary | |
---|---|
ThreadQueue()
Creates a new, unlimited instance of ThreadQueue |
|
ThreadQueue(int limit)
Creates a new instance of ThreadQueue, which will block if the amount of queued elements reaches the given limit |
Method Summary | |
---|---|
void |
add(java.lang.Runnable thread)
adds a new object to the end of the queue. |
int |
getLimit()
|
java.lang.Runnable |
remove()
Removes the first object from the queue, blocking until one is available. |
void |
setLimit(int limit)
Sets the max size of this queue, adding new elements will block when the queue size would get bigger than the limit |
int |
size()
Returns the current number of object in the queue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ThreadQueue()
public ThreadQueue(int limit)
limit
- Method Detail |
---|
public int size()
public void setLimit(int limit)
limit
- max amount of elements this queue can contain at one timepublic int getLimit()
public void add(java.lang.Runnable thread)
public java.lang.Runnable remove()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |