|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectAbstractQueue<E>
ArrayQueue<E>
public class ArrayQueue<E>
Implements a simple queue using an array
| Constructor Summary | |
|---|---|
ArrayQueue()
No argument constructor |
|
| Method Summary | |
|---|---|
static void |
main(String[] args)
Main method for testing |
E |
peek()
Peek at, but don't remove, the head of the queue |
E |
pop()
Pop an object from the Queue |
void |
push(E element)
Push an element onto the tail of the Queue |
int |
size()
Return the size of a queue |
| Methods inherited from class AbstractQueue |
|---|
isEmpty |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ArrayQueue()
| Method Detail |
|---|
public void push(E element)
push in interface Queue<E>push in class AbstractQueue<E>element - the element to add to the queuepublic E peek()
peek in interface Queue<E>peek in class AbstractQueue<E>public E pop()
pop in interface Queue<E>pop in class AbstractQueue<E>public int size()
size in interface Queue<E>size in class AbstractQueue<E>public static void main(String[] args)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||