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.ClosedException
T dequeue() throws IBlockingQueue.ClosedException
IBlockingQueue.ClosedException
T peek() throws IBlockingQueue.ClosedException
IBlockingQueue.ClosedException
T dequeue(long timeout) throws IBlockingQueue.ClosedException, TimeoutException
timeout
- the time to wait (in millis) or -1 for no timeout.IBlockingQueue.ClosedException
TimeoutException
java.util.List<T> setClosed(boolean closed)
closed
- The closed state.boolean isClosed()
int size()