Interface Queue<E>

All Known Implementing Classes:
AbstractQueue, ArrayQueue, LinkedListQueue

public interface Queue<E>

Interface to define an abstract queue

Author:
Barb Ericson

Method Summary
 boolean isEmpty()
          Method to see if the queue is empty
 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
 

Method Detail

push

void push(E element)
Push an element onto the tail of the Queue

Parameters:
element - the element to add to the queue

peek

E peek()
Peek at, but don't remove, the head of the queue

Returns:
the head of the queue (top)

pop

E pop()
Pop an object from the Queue

Returns:
the head (top) of the queue and remove it from the queue

size

int size()
Return the size of a queue

Returns:
the number of elements in the queue

isEmpty

boolean isEmpty()
Method to see if the queue is empty

Returns:
true if the queue is empty, else false