站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 common API Documentation 英文版文档

Queue (JBoss/Common API) - JBoss 4.0.1 sp1 common API Documentation 英文版文档


org.jboss.util.collection
Interface Queue

All Superinterfaces:
Collection
All Known Implementing Classes:
AbstractQueue

public interface Queue
extends Collection

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

Version:
$Revision: 1.1 $
Author:
Jason Dillon

Field Summary
static int UNLIMITED_MAXIMUM_SIZE
          Unlimited maximum queue size identifier.
 
Method Summary
 boolean add(Object obj)
          Enqueue an object onto the queue.
 Object getBack()
          Get the object at the back of the queue.
 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.
 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
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 IllegalArgumentException
Set the maximum size of the queue.

Parameters:
size - New maximim pool size or UNLIMITED_MAXIMUM_SIZE.
Throws:
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 Collection
Returns:
True if the queue is empty.

add

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

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

remove

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

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

getFront

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

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

getBack

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

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


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.