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>,org.apache.jena.atlas.iterator.IteratorCloseable<T>,org.apache.jena.atlas.lib.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
Modifier and TypeMethodDescriptionvoidforEachRemaining(Consumer<? super T> action) forEachRemaining: defer to the base iteratorbooleanhasNext()Answer true iff there is at least one more acceptable object.next()Answer the next acceptable object from the base iterator.voidremove()Remove the current member from the underlying iterator.Methods inherited from class org.apache.jena.util.iterator.WrappedIterator
close, close, create, createIteratorIterator, createNoRemove, forTestingOnly_getBase, ofStreamMethods inherited from class org.apache.jena.util.iterator.NiceIterator
andThen, andThen, asList, asSet, emptyIterator, filterDrop, filterKeep, mapWith, removeNext, toList, toSetMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.jena.util.iterator.ExtendedIterator
forEach, nextOptional
-
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, setscanRemovefalse; 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. -
forEachRemaining
Description copied from class:WrappedIteratorforEachRemaining: defer to the base iterator- Specified by:
forEachRemainingin interfaceIterator<T>- Overrides:
forEachRemainingin classWrappedIterator<T>
-