public interface IBlockingQueue<T>
| Modifier and Type | Interface and Description |
|---|---|
static class |
IBlockingQueue.ClosedException
Closed exception.
|
| Modifier and Type | Method and Description |
|---|---|
T |
dequeue()
Dequeue an element.
|
T |
dequeue(long timeout)
Dequeue an element.
|
void |
enqueue(T element)
Enqueue an element.
|
boolean |
isClosed()
Check if the queue is closed.
|
T |
peek()
Peek the topmost element without dequeuing it.
|
java.util.List<T> |
setClosed(boolean closed)
Open/close the queue.
|
int |
size()
Get the size.
|
void enqueue(T element) throws IBlockingQueue.ClosedException
element - The element.IBlockingQueue.ClosedExceptionT dequeue() throws IBlockingQueue.ClosedException
IBlockingQueue.ClosedExceptionT peek() throws IBlockingQueue.ClosedException
IBlockingQueue.ClosedExceptionT dequeue(long timeout) throws IBlockingQueue.ClosedException, TimeoutException
timeout - the time to wait (in millis) or -1 for no timeout.IBlockingQueue.ClosedExceptionTimeoutExceptionjava.util.List<T> setClosed(boolean closed)
closed - The closed state.boolean isClosed()
int size()