|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object AbstractQueue<E> LinkedListQueue<E>
public class LinkedListQueue<E>
Implements a simple queue using a linked list
Constructor Summary | |
---|---|
LinkedListQueue()
No argument constructor |
Method Summary | |
---|---|
static void |
main(String[] args)
Main method for testing |
E |
peek()
Peek at, but don't remove, top (first) of 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 LinkedListQueue()
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 |