Package jadex.commons.collection
Interface IBlockingQueue<T>
- 
- All Known Implementing Classes:
- ArrayBlockingQueue,- BlockingQueue
 
 public interface IBlockingQueue<T>A queue that blocks until an element is available.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static classIBlockingQueue.ClosedExceptionClosed exception.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description Tdequeue()Dequeue an element.Tdequeue(long timeout)Dequeue an element.voidenqueue(T element)Enqueue an element.booleanisClosed()Check if the queue is closed.Tpeek()Peek the topmost element without dequeuing it.java.util.List<T>setClosed(boolean closed)Open/close the queue.intsize()Get the size.
 
- 
- 
- 
Method Detail- 
enqueuevoid enqueue(T element) throws IBlockingQueue.ClosedException Enqueue an element.- Parameters:
- element- The element.
- Throws:
- IBlockingQueue.ClosedException
 
 - 
dequeueT dequeue() throws IBlockingQueue.ClosedException Dequeue an element.- Returns:
- The element. When queue is empty the methods blocks until an element is added.
- Throws:
- IBlockingQueue.ClosedException
 
 - 
peekT peek() throws IBlockingQueue.ClosedException Peek the topmost element without dequeuing it.- Returns:
- The element. When queue is empty the methods blocks until an element is added.
- Throws:
- IBlockingQueue.ClosedException
 
 - 
dequeueT dequeue(long timeout) throws IBlockingQueue.ClosedException, java.util.concurrent.TimeoutException Dequeue an element.- Parameters:
- timeout- the time to wait (in millis) or -1 for no timeout.
- Returns:
- The element. When queue is empty the methods blocks until an element is added or the timeout occurs.
- Throws:
- IBlockingQueue.ClosedException
- java.util.concurrent.TimeoutException
 
 - 
setClosedjava.util.List<T> setClosed(boolean closed) Open/close the queue.- Parameters:
- closed- The closed state.
- Returns:
- The remaining elements after the queue has been closed.
 
 - 
isClosedboolean isClosed() Check if the queue is closed.
 - 
sizeint size() Get the size.- Returns:
- The size.
 
 
- 
 
-