java.lang.Object
org.apache.jena.util.iterator.NiceIterator<T>
org.apache.jena.util.iterator.WrappedIterator<T>
- All Implemented Interfaces:
Iterator<T>,org.apache.jena.atlas.iterator.IteratorCloseable<T>,org.apache.jena.atlas.lib.Closeable,ClosableIterator<T>,ExtendedIterator<T>
- Direct Known Subclasses:
FilterIterator,NodeIteratorImpl,NsIteratorImpl,ResIteratorImpl,StmtIteratorImpl,TrackingTripleIterator
a WrappedIterator is an ExtendedIterator wrapping around a plain (or
presented as plain) Iterator. The wrapping allows the usual extended
operations (filtering, concatenating) to be done on an Iterator derived
from some other source.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()close: defer to the base, iff it is closablestatic voidifitis a Closableiterator, close it.static <T> ExtendedIterator<T>Answer an ExtendedIterator returning the elements ofit.static <T> ExtendedIterator<T>createIteratorIterator(Iterator<Iterator<T>> it) Given an Iterator that returns Iterator's, this creates an Iterator over the next level values.static <T> WrappedIterator<T>createNoRemove(Iterator<T> it) Answer an ExtendedIterator wrapped rounditwhich does not permit.remove()even ifitdoes.voidforEachRemaining(Consumer<? super T> action) forEachRemaining: defer to the base iteratorbooleanhasNext()hasNext: defer to the base iteratornext()next: defer to the base iteratorstatic <T> WrappedIterator<T>Answer an ExtendedIterator wrapped round aStream.voidremove()default remove: we have no elements, so we can't remove any.Methods 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
-
Method Details
-
create
Answer an ExtendedIterator returning the elements ofit. Ifitis itself an ExtendedIterator, return that; otherwise wrapit. -
createNoRemove
Answer an ExtendedIterator wrapped rounditwhich does not permit.remove()even ifitdoes. -
ofStream
Answer an ExtendedIterator wrapped round aStream. The extended iterator does not permit.remove().The stream should not be used directly. The effect of doing so is undefined.
-
createIteratorIterator
Given an Iterator that returns Iterator's, this creates an Iterator over the next level values. Similar to list splicing in lisp. -
forTestingOnly_getBase
-
hasNext
public boolean hasNext()hasNext: defer to the base iterator -
next
next: defer to the base iterator -
forEachRemaining
forEachRemaining: defer to the base iterator -
remove
public void remove()Description copied from class:NiceIteratordefault remove: we have no elements, so we can't remove any. -
close
public void close()close: defer to the base, iff it is closable- Specified by:
closein interfaceClosableIterator<T>- Specified by:
closein interfaceorg.apache.jena.atlas.lib.Closeable- Overrides:
closein classNiceIterator<T>
-
close
ifitis a Closableiterator, close it. Abstracts away from tests [that were] scattered through the code.
-