Jadex 0.96-beta1

jadex.util.collection
Interface IBlockingQueue

All Known Implementing Classes:
ArrayBlockingQueue, BlockingQueue

public interface IBlockingQueue

A queue that blocks until an element is available.


Nested Class Summary
static class IBlockingQueue.ClosedException
          Closed exception.
static class IBlockingQueue.TimeoutException
          Timeout exception.
 
Method Summary
 Object dequeue()
          Dequeue an element.
 Object dequeue(long timeout)
          Dequeue an element.
 void enqueue(Object element)
          Enqueue an element.
 void setClosed(boolean closed)
          Open/close the queue.
 int size()
          Get the size.
 

Method Detail

enqueue

void enqueue(Object element)
             throws IBlockingQueue.ClosedException
Enqueue an element.

Parameters:
element - The element.
Throws:
IBlockingQueue.ClosedException

dequeue

Object 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

dequeue

Object dequeue(long timeout)
               throws IBlockingQueue.ClosedException,
                      IBlockingQueue.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
IBlockingQueue.TimeoutException

setClosed

void setClosed(boolean closed)
Open/close the queue.

Parameters:
closed - The closed state.

size

int size()
Get the size.

Returns:
The size.

Jadex 0.96-beta1

Submit a bug or feature
For further API reference and developer documentation, see the Jadex User Guide and the Jadex Tutorial. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, and working code examples.

Copyright (C) 2002-2007 Lars Braubach, Alexander Pokahr - University of Hamburg. Use is subject to license terms.