Package org.plumelib.util
Class CollectionsPlume.FilteredIterator<T extends @Nullable Object>
java.lang.Object
org.plumelib.util.CollectionsPlume.FilteredIterator<T>
- Type Parameters:
T
- the type of elements of the iterator
- All Implemented Interfaces:
Iterator<T>
- Enclosing class:
- CollectionsPlume
public static final class CollectionsPlume.FilteredIterator<T extends @Nullable Object>
extends Object
implements Iterator<T>
An iterator that only returns elements that match the given predicate.
-
Constructor Summary
ConstructorDescriptionFilteredIterator
(Iterator<T> itor, Predicate<T> predicate) Create an iterator that only returns elements ofitor
that match the given predicate. -
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
-
FilteredIterator
Create an iterator that only returns elements ofitor
that match the given predicate.- Parameters:
itor
- the Iterator to filterpredicate
- the predicate that determines which elements to retain
-
-
Method Details