Class CriterionIterator<T>
java.lang.Object
com.saperion.common.lang.iterator.CriterionIterator<T>
- Type Parameters:
T
- type of objects to iterate
- All Implemented Interfaces:
Iterator<T>
An Iterator
that filters the objects of an existing iterator using a Criterion
.
Iterator.remove()
is not supported.
- Author:
- agz
-
Constructor Summary
ConstructorsConstructorDescriptionCriterionIterator
(Iterator<? extends T> iterator, Criterion<? super T> criterion) Creates a newCriterionIterator
, that filters the objects of the specified iterator using the specifiedCriterion
. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
CriterionIterator
Creates a newCriterionIterator
, that filters the objects of the specified iterator using the specifiedCriterion
. The specified iterator must not benull
. The specified criterion may benull
, in which case no filtering is done and the returned iterator iterates through all objects of the specified iterator.- Parameters:
iterator
- underlying iterator whose iteration should be filteredcriterion
- filter-Criterion
-
-
Method Details