m865.datastructures
Class PriorityQueueAL.PriorityQueueALIterator

java.lang.Object
  extended by m865.datastructures.PriorityQueueAL.PriorityQueueALIterator
All Implemented Interfaces:
java.util.Iterator
Enclosing class:
PriorityQueueAL

public class PriorityQueueAL.PriorityQueueALIterator
extends java.lang.Object
implements java.util.Iterator

The iterator for this PriorityQueueAL class.


Constructor Summary
PriorityQueueAL.PriorityQueueALIterator(PriorityQueueAL q)
          Constructor for a PriorityQueueALIterator
 
Method Summary
 boolean hasNext()
          Determines if there is an object in the priority queue that can be returned by next().
 Prioritizeable next()
          Returns the next object in priority queue, if there is one.
 void remove()
          Removes the last object returned by the iterator from the priority queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PriorityQueueAL.PriorityQueueALIterator

public PriorityQueueAL.PriorityQueueALIterator(PriorityQueueAL q)
Constructor for a PriorityQueueALIterator

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

hasNext

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

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

next

public Prioritizeable next()
Returns the next object in priority 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 priority queue.

remove

public void remove()
Removes the last object returned by the iterator from the priority queue.

Specified by:
remove in interface java.util.Iterator