|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmako5.util.ArrayQueue<T>
public class ArrayQueue<T>
A circular array queue class.
Queue
Constructor Summary | |
---|---|
ArrayQueue()
Makes an empty circular queue of size 0. |
|
ArrayQueue(int initialCapacity)
Creates an empty queue using the specified capacity. |
Method Summary | |
---|---|
void |
clear()
Clears all elements from this queue. |
T |
dequeue()
Removes the element at the front of this queue and returns a reference to it. |
void |
enqueue(T val)
Adds an item to the queue. |
T |
first()
Peeks at the first element in this queue. |
boolean |
isEmpty()
Returns true when the queue is empty. |
boolean |
isFull()
Returns true if this queue is full. |
int |
size()
Returns the current number of elements in the queue. |
String |
toString()
Returns this as a string. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ArrayQueue()
public ArrayQueue(int initialCapacity)
initialCapacity
- indicates the initial size of the internal array.Method Detail |
---|
public void enqueue(T val)
enqueue
in interface Queue<T>
val
- the thing to addpublic T dequeue()
dequeue
in interface Queue<T>
public T first()
public boolean isEmpty()
isEmpty
in interface Queue<T>
public int size()
size
in interface Queue<T>
public boolean isFull()
public void clear()
clear
in interface Queue<T>
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |