Class ForwardingIteratorWithForcedRemoval<T>
java.lang.Object
org.aksw.jena_sparql_api.rdf.collections.ForwardingIteratorWithForcedRemoval<T>
- Type Parameters:
T-
- All Implemented Interfaces:
Iterator<T>,org.apache.jena.atlas.iterator.IteratorCloseable<T>,org.apache.jena.atlas.lib.Closeable,org.apache.jena.util.iterator.ClosableIterator<T>
public class ForwardingIteratorWithForcedRemoval<T>
extends Object
implements org.apache.jena.util.iterator.ClosableIterator<T>
Iterator that forwards calls to another iterator. If it turns out that .remove() is not supported,
the remaining items in the iterator will be preloaded at once. Removal will then pass the current
item to a lambda that can remove the item from the underlying collection directly, such as by invoking
collection.remove(item).
- Author:
- raven
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionForwardingIteratorWithForcedRemoval(Iterator<T> delegate, Consumer<T> forceRemover) ForwardingIteratorWithForcedRemoval(Iterator<T> delegate, Consumer<T> forceRemover, boolean delegateRemoval) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
originalDelegate
-
effectiveDelegate
-
forceRemover
-
delegateRemoval
protected boolean delegateRemoval -
isNextCalled
protected boolean isNextCalled -
currentItem
-
-
Constructor Details
-
ForwardingIteratorWithForcedRemoval
-
ForwardingIteratorWithForcedRemoval
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
remove
public void remove() -
close
public void close()- Specified by:
closein interfaceorg.apache.jena.util.iterator.ClosableIterator<T>- Specified by:
closein interfaceorg.apache.jena.atlas.lib.Closeable
-