|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ch.elca.dependency.util.ArrayQueue
Implementation of the standard Queue
interface.
Constructor Summary | |
ArrayQueue()
Constructor - Initializes the fields. |
|
ArrayQueue(int capacity)
Constructor - Initializes the fields. |
Method Summary | |
java.lang.Object |
dequeue()
Remove and return from the queue the object at the front. |
void |
enqueue(java.lang.Object o)
Insert object o at the rear of the queue. |
java.lang.Object |
front()
Return, but do not remove, the front object in the queue. |
boolean |
isEmpty()
Return a boolean value that indicates whether the queue is empty. |
int |
size()
Return the number of objects in the queue. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ArrayQueue()
public ArrayQueue(int capacity)
capacity
- an int
valueMethod Detail |
public void enqueue(java.lang.Object o) throws QueueFullException
enqueue
in interface Queue
o
- Object to be inserted at the rear of the queue.
QueueFullException
- If the queue is full.public java.lang.Object dequeue() throws QueueEmptyException
dequeue
in interface Queue
QueueEmptyException
- If the queue is empty.public int size()
size
in interface Queue
public boolean isEmpty()
isEmpty
in interface Queue
public java.lang.Object front() throws QueueEmptyException
front
in interface Queue
QueueEmptyException
- If the queue is empty.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |