| |
|
| java.lang.Object com.quadcap.util.collections.ArrayQueue
ArrayQueue | public class ArrayQueue implements Queue(Code) | | Implements the Queue interface using a growable array.
author: Stan Bailes |
Constructor Summary | |
public | ArrayQueue() | public | ArrayQueue(int capacity) | public | ArrayQueue(int initialSize, int capacity) Create an ArrayQueue with an initial capacity. |
ArrayQueue | public ArrayQueue()(Code) | | Create an empty Array queue with unbounded capacity
|
ArrayQueue | public ArrayQueue(int capacity)(Code) | | Create an empty queue with an initial capacity
|
ArrayQueue | public ArrayQueue(int initialSize, int capacity)(Code) | | Create an ArrayQueue with an initial capacity.
|
checkSizeForAdd | final void checkSizeForAdd()(Code) | | |
head | final public Object head()(Code) | | Access the object at the front of the queue. Return null
if the queue is empty.
the item at the head of the queue |
popBack | final public Object popBack()(Code) | | Remove and return the item at the back of the queue. Return null
if the queue is empty.
the item at the tail of the queue |
popFront | final public Object popFront()(Code) | | Remove and return the item at the front of the queue. Return null
if the queue is empty.
the item at the head of the queue |
pushBack | final public void pushBack(Object obj)(Code) | | Add an object to the back of the queue.
Parameters: obj - the object to add |
pushFront | final public void pushFront(Object obj)(Code) | | Add an object to the front of the queue.
Parameters: obj - the object to add |
remove | final public void remove(Object obj)(Code) | | Remove the specified object
|
resize | final void resize(int newsize)(Code) | | |
setCapacity | final public void setCapacity(int capacity)(Code) | | Specify the maximum capacity of this queue, -1 means unbounded.
Parameters: capacity - the new capacity of the queue, or -1 to specify aqueue of unlimited size. |
size | final public int size()(Code) | | Return the number of items in the queue.
the queue's size |
tail | final public Object tail()(Code) | | Access the object at the back of the queue. Return null
if the queue is empty.
the item at the tail of the queue |
|
|
|