public class BlockingQueue
extends java.lang.Object
| Constructor and Description |
|---|
BlockingQueue()
Constructs a BlockingQueue of unlimited size.
|
BlockingQueue(int maximumSize)
Constructs a BlockingQueue with the requested size.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(java.lang.Object someObject)
Adds an object to the end of the queue.
|
void |
close()
Closes the queue.
|
void |
closeWhenEmpty()
Closes the queue after it empties.
|
int |
getCurrentSize()
Returns the current size.
|
java.lang.Object |
remove()
Removes an object from the front of the queue.
|
void |
waitUntilEmpty()
Waits for the queue to empty.
|
public BlockingQueue()
public BlockingQueue(int maximumSize)
public void add(java.lang.Object someObject)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic java.lang.Object remove()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic int getCurrentSize()
public void waitUntilEmpty()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void closeWhenEmpty()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void close()