m865.datastructures
Class QueueAL.QueueALIterator

java.lang.Object
  extended bym865.datastructures.QueueAL.QueueALIterator
All Implemented Interfaces:
java.util.Iterator
Enclosing class:
QueueAL

public class QueueAL.QueueALIterator
extends java.lang.Object
implements java.util.Iterator

An iterator for this queue.


Constructor Summary
protected QueueAL.QueueALIterator(QueueAL q)
          Constructor for a QueueALIterator
 
Method Summary
 boolean hasNext()
          Determines if there is an object in the queue that can be returned by next().
 java.lang.Object next()
          Returns the next object in queue, if there is one.
 void remove()
          This method is an optional method of the Iterator interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueueAL.QueueALIterator

protected QueueAL.QueueALIterator(QueueAL q)
Constructor for a QueueALIterator

Parameters:
q - The queue for this iterator.
Method Detail

hasNext

public boolean hasNext()
Determines if there is an object in the queue that can be returned by next().

Specified by:
hasNext in interface java.util.Iterator
Returns:
true - if there is an object in the queue that can be returned by next().

next

public java.lang.Object next()
Returns the next object in queue, if there is one. It throws a ConcurrentModificationException if the queue has been changed during the iteration.

Specified by:
next in interface java.util.Iterator
Returns:
the next object in the queue.

remove

public void remove()
This method is an optional method of the Iterator interface. If implemented, it would remove from the queue the last element returned by the iterator. Since this would violate the integrity of the abstract queue data structure it is not implemented. Throws an UnsupportedOperationException.

Specified by:
remove in interface java.util.Iterator