org.jboss.util.collection
Interface Queue

All Superinterfaces:
java.util.Collection
All Known Implementing Classes:
AbstractQueue (src)

public interface Queue
extends java.util.Collection

An iterface used to implement a first-in, first-out container.


Field Summary
static int UNLIMITED_MAXIMUM_SIZE
          Unlimited maximum queue size identifier.
 
Method Summary
 boolean add(java.lang.Object obj)
          Enqueue an object onto the queue.
 java.lang.Object getBack()
          Get the object at the back of the queue.
 java.lang.Object getFront()
          Get the object at the front of the queue.
 int getMaximumSize()
          Get the maximum size of the queue.
 boolean isEmpty()
          Check if the queue is empty.
 boolean isFull()
          Check if the queue is full.
 java.lang.Object remove()
          Dequeue an object from the queue.
 void setMaximumSize(int size)
          Set the maximum size of the queue.
 
Methods inherited from interface java.util.Collection
addAll, clear, contains, containsAll, equals, hashCode, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Field Detail

UNLIMITED_MAXIMUM_SIZE

public static final int UNLIMITED_MAXIMUM_SIZE
Unlimited maximum queue size identifier.

See Also:
Constant Field Values (src)
Method Detail

getMaximumSize

public int getMaximumSize()
Get the maximum size of the queue.

Returns:
Maximum pool size or UNLIMITED_MAXIMUM_SIZE.

setMaximumSize

public void setMaximumSize(int size)
                    throws java.lang.IllegalArgumentException
Set the maximum size of the queue.

Parameters:
size - New maximim pool size or UNLIMITED_MAXIMUM_SIZE.
Throws:
java.lang.IllegalArgumentException - Illegal size.

isFull

public boolean isFull()
Check if the queue is full.

Returns:
True if the queue is full.

isEmpty

public boolean isEmpty()
Check if the queue is empty.

Specified by:
isEmpty in interface java.util.Collection
Returns:
True if the queue is empty.

add

public boolean add(java.lang.Object obj)
            throws FullCollectionException (src) 
Enqueue an object onto the queue.

Specified by:
add in interface java.util.Collection
Parameters:
obj - Object to enqueue.
Returns:
True if collection was modified.
Throws:
FullCollectionException (src) - The queue is full.

remove

public java.lang.Object remove()
                        throws EmptyCollectionException (src) 
Dequeue an object from the queue.

Returns:
Dequeued object.
Throws:
EmptyCollectionException (src) - The queue is empty.

getFront

public java.lang.Object getFront()
                          throws EmptyCollectionException (src) 
Get the object at the front of the queue.

Returns:
Object at the front of the queue.
Throws:
EmptyCollectionException (src) - The queue is empty.

getBack

public java.lang.Object getBack()
                         throws EmptyCollectionException (src) 
Get the object at the back of the queue.

Returns:
Object at the back of the queue.
Throws:
EmptyCollectionException (src) - The queue is empty.