Class Queue

java.lang.Object
  extended byQueue

public class Queue
extends Object

Implements a simple queue


Field Summary
 LinkedList elements
          Where we'll store our elements
 
Constructor Summary
Queue()
           
 
Method Summary
 boolean empty()
          Empty?
 Object peek()
          Peek at, but don't remove, top of queue
 Object pop()
          Pop an object from the Queue
 void push(Object element)
          Push an object onto the Queue
 int size()
          Return the size of a queue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

elements

public LinkedList elements
Where we'll store our elements

Constructor Detail

Queue

public Queue()
Method Detail

push

public void push(Object element)
Push an object onto the Queue


peek

public Object peek()
Peek at, but don't remove, top of queue


pop

public Object pop()
Pop an object from the Queue


size

public int size()
Return the size of a queue


empty

public boolean empty()
Empty?