|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.myfaces.buildtools.maven2.plugin.javascript.uixtools.Queue
public class Queue
Implements a first-in-first-out (FIFO) queue. Typically, one thread will add elements to this queue, and another will remove elements from this queue. This class is thread safe.
| Constructor Summary | |
|---|---|
Queue(int size)
|
|
| Method Summary | |
|---|---|
void |
add(java.lang.Object obj)
This method blocks until space is available in this queue. |
void |
close()
closes this queue. |
boolean |
isClosed()
|
boolean |
isEmpty()
|
boolean |
isFull()
|
java.lang.Object |
remove()
This method blocks until some element is added to this queue, or the queue is closed. |
int |
remove(java.util.List collector,
int count)
Removes multiple elements. |
int |
size()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Queue(int size)
size - the maximum size of this queue| Method Detail |
|---|
public final int size()
maximum size of this queue.public final boolean isClosed()
close()public void close()
add(Object) method calls will
fail. All #get() operations will succeed until the queue is
empty. This method may be called multiple times.
isClosed()public final boolean isFull()
add(Object)
would block.public final boolean isEmpty()
#get()
would block.
public void add(java.lang.Object obj)
throws java.lang.InterruptedException,
java.lang.IllegalStateException
obj - the Object to add to the end of this queue. null is permitted.
java.lang.InterruptedException - if the current thread is interrupted.
java.lang.IllegalStateException - if queue is closed.close(),
remove()
public java.lang.Object remove()
throws java.lang.InterruptedException,
java.lang.IllegalStateException
add(Object)
java.lang.InterruptedException - if the current thread is interrupted.
java.lang.IllegalStateException - if queue is closed.close(),
add(Object),
#remove(LIst,int)
public int remove(java.util.List collector,
int count)
throws java.lang.InterruptedException,
java.lang.IllegalStateException
collector - all the elements removed from this queue are added to
the end of this List.count - the maximum number of elements to remove. If this is zero,
then it defaults to the maximum size of this queue.
java.lang.InterruptedException
java.lang.IllegalStateExceptionremove()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||