java.lang.Object
org.apache.jena.util.iterator.NiceIterator<T>
org.apache.jena.util.iterator.WrappedIterator<T>
org.apache.jena.util.iterator.FilterIterator<T>
- All Implemented Interfaces:
Iterator<T>
,IteratorCloseable<T>
,Closeable
,ClosableIterator<T>
,ExtendedIterator<T>
Creates a sub-Iterator by filtering. This class should not be used
directly any more; the subclasses FilterKeepIterator and FilterDropIterator
should be used instead.
-
Constructor Summary
ConstructorsConstructorDescriptionFilterIterator
(Predicate<T> fl, Iterator<T> e) Initialises a FilterIterator with its filter and base. -
Method Summary
Methods inherited from class org.apache.jena.util.iterator.WrappedIterator
close, close, create, createIteratorIterator, createNoRemove, forTestingOnly_getBase, ofStream
Methods inherited from class org.apache.jena.util.iterator.NiceIterator
andThen, andThen, asList, asSet, emptyIterator, filterDrop, filterKeep, mapWith, removeNext, toList, toSet
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.jena.util.iterator.ExtendedIterator
forEach, nextOptional
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
FilterIterator
Initialises a FilterIterator with its filter and base.- Parameters:
fl
- An object is included if it is accepted by this Filter.e
- The base Iterator.
-
-
Method Details
-
hasNext
public boolean hasNext()Answer true iff there is at least one more acceptable object. [Stores reference intocurrent
, setscanRemove
false; answer preserved in `hasCurrent`] -
remove
public void remove()Remove the current member from the underlying iterator. Legal only after a .next() but before any subsequent .hasNext(), because that may advance the underlying iterator. -
next
Answer the next acceptable object from the base iterator. The redundant test of `hasCurrent` appears to make a detectable speed difference. Crazy.
-