Class FilterIterator<T>
java.lang.Object
com.github.basking2.sdsai.itrex.iterators.FilterIterator<T>
- Type Parameters:
T
- The element type to filter.
- All Implemented Interfaces:
Iterator<T>
Similar to the
NullSkippingIterator
, this will skip values if they fail a provided check.
Skipping is done by prefetching 1 element to ensure we can accurately compute hasNext()
.-
Constructor Details
-
FilterIterator
- Parameters:
iterator
- The iterator of elements.predicate
- A predicate that checks elements returned by the iterator for inclusion in this iterator.- See Also:
-
-
Method Details