DataStructures
Class QueueList<E>

java.lang.Object
  extended by DataStructures.QueueList<E>
Type Parameters:
E - the type of elements held in this queue
All Implemented Interfaces:
Queue<E>

public class QueueList<E>
extends java.lang.Object
implements Queue<E>

A linked list implementation of a queue

Author:
Peter Williams

Constructor Summary
QueueList()
          Creates an empty queue suitable for holding items of type E
 
Method Summary
 E dequeue()
          Detaches an item from the queue.
 void enqueue(E item)
          Attaches an item to the queue.
 boolean isEmpty()
          Indicates the status of the queue.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueueList

public QueueList()
Creates an empty queue suitable for holding items of type E

Method Detail

isEmpty

public boolean isEmpty()
Description copied from interface: Queue
Indicates the status of the queue.

Specified by:
isEmpty in interface Queue<E>
Returns:
true if the queue is empty.

enqueue

public void enqueue(E item)
Description copied from interface: Queue
Attaches an item to the queue.

Specified by:
enqueue in interface Queue<E>
Parameters:
item - the item of type E to be queued.

dequeue

public E dequeue()
Description copied from interface: Queue
Detaches an item from the queue.

Specified by:
dequeue in interface Queue<E>
Returns:
the item least recently queued.