Package ch.njol.util.coll.iterator
Class StoppableIterator<T>
java.lang.Object
ch.njol.util.coll.iterator.StoppableIterator<T>
- All Implemented Interfaces:
Iterator<T>
- Direct Known Subclasses:
BlockLineIterator
-
Constructor Summary
ConstructorDescriptionStoppableIterator
(Iterator<T> iter, NullableChecker<T> stopper, boolean returnLast) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
StoppableIterator
- Parameters:
iter
-stopper
- Called for every element. If it returns true the iteration is stopped.returnLast
- Whether to return the last element, i.e. the element on which the stopper stops. This doesn't change anything if the iterator ends before the stopper stops.
-
-
Method Details