Class FairBlockingQueue.FairIterator
java.lang.Object
org.apache.tomcat.jdbc.pool.FairBlockingQueue.FairIterator
- All Implemented Interfaces:
Iterator<E>
- Enclosing class:
FairBlockingQueue<E>
Iterator safe from concurrent modification exceptions. The iterator walks a snapshot of the queue contents taken
when it was created, but
remove() removes the last returned element - or, for element types with value
semantics, an element equal to it - from the live queue.
An element that was taken out of the queue and offered back as the same object between the snapshot and the
removal is therefore also removed from the live queue - like the weakly consistent iterators of the JDK, this
iterator makes no promise about seeing the current state of the queue.-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new FairIterator with a snapshot of the current queue contents. -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterator
forEachRemaining
-
Constructor Details
-
FairIterator
public FairIterator()Creates a new FairIterator with a snapshot of the current queue contents.
-
-
Method Details
-
hasNext
-
next
-
remove
-