m865.datastructures
Class BalkingQueue.BalkingQueueIterator

java.lang.Object
  extended bym865.datastructures.BalkingQueue.BalkingQueueIterator
All Implemented Interfaces:
java.util.Iterator
Enclosing class:
BalkingQueue

public class BalkingQueue.BalkingQueueIterator
extends java.lang.Object
implements java.util.Iterator

An iterator for a BalkingQueue.


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()
          Removes the last element returned by the iterator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasNext

public boolean hasNext()
Determines if there is an object in the queue that can be returned by next(). It throws a ConcurrentModificationException if the queue has been altered.

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 or throws a NoSuchElement exception if there are no more objects to be returned.

remove

public void remove()
Removes the last element returned by the iterator. It throws a ConcurrentModificationException if the queue has been changed during the iteration. It throws a NoSuchElementException if no element has been returned by next().

Specified by:
remove in interface java.util.Iterator