Package org.apache.tomcat.jdbc.pool
Class FairBlockingQueue.FairIterator
- java.lang.Object
-
- org.apache.tomcat.jdbc.pool.FairBlockingQueue.FairIterator
-
- All Implemented Interfaces:
java.util.Iterator<E>
- Enclosing class:
- FairBlockingQueue<E>
protected class FairBlockingQueue.FairIterator extends java.lang.Object implements java.util.Iterator<E>Iterator safe from concurrent modification exceptions. The iterator walks a snapshot of the queue contents taken when it was created, butremove()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
Constructors Constructor Description FairIterator()Creates a new FairIterator with a snapshot of the current queue contents.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()Enext()voidremove()
-