DataStructures
Class QueueArray<E>

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

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

An array implementation of a queue

Author:
Peter Williams

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

QueueArray

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