DataStructures
Class QueueList

java.lang.Object
  |
  +--DataStructures.QueueList
All Implemented Interfaces:
Queue

public class QueueList
extends java.lang.Object
implements Queue

A linked list implementation of a queue

Author:
Peter Williams

Constructor Summary
QueueList()
           
 
Method Summary
 java.lang.Object dequeue()
          Detaches an item from the queue.
 void enqueue(java.lang.Object item)
          Attaches an item to the queue.
 boolean isEmpty()
          Indicates the status of the queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueueList

public QueueList()
Method Detail

isEmpty

public boolean isEmpty()
Description copied from interface: Queue
Indicates the status of the queue.
Specified by:
isEmpty in interface Queue
Following copied from interface: DataStructures.Queue
Returns:
true if the queue is empty.

enqueue

public void enqueue(java.lang.Object item)
Description copied from interface: Queue
Attaches an item to the queue.
Specified by:
enqueue in interface Queue
Following copied from interface: DataStructures.Queue
Parameters:
item - the Object to be queued.

dequeue

public java.lang.Object dequeue()
Description copied from interface: Queue
Detaches an item from the queue.
Specified by:
dequeue in interface Queue
Following copied from interface: DataStructures.Queue
Returns:
the item least recently queued.
Throws:
NoSuchElementException - if the queue is empty.