DataStructures
Class QueueArray

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

public class QueueArray
extends java.lang.Object
implements Queue

An array implementation of a queue

Author:
Peter Williams

Constructor Summary
QueueArray()
           
 
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

QueueArray

public QueueArray()
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.