Class AbortiveMultiIterator<T>
java.lang.Object
org.apache.tinkerpop.gremlin.util.iterator.AbortiveMultiIterator<T>
- All Implemented Interfaces:
Serializable,AutoCloseable,Iterator<T>
public final class AbortiveMultiIterator<T>
extends Object
implements Iterator<T>, Serializable, AutoCloseable
An
Iterator that checks a Predicate prior to processing the specified child Iterator
instances.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIterator(Iterator<T> iterator) Adds anIteratorthat will always be iterated.voidaddIterator(Iterator<T> iterator, Predicate<Long> check) Adds anIteratorthat will iterate only if thecheckpasses.voidclear()voidclose()Close the underlying iterators if auto-closeable.booleanhasNext()next()voidremove()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
-
Constructor Details
-
AbortiveMultiIterator
public AbortiveMultiIterator()
-
-
Method Details
-
addIterator
Adds anIteratorthat will always be iterated. -
addIterator
Adds anIteratorthat will iterate only if thecheckpasses.- Parameters:
check- when returningtrueprocessing of the associatedIteratorwill proceed
-
hasNext
public boolean hasNext() -
remove
public void remove() -
next
-
clear
public void clear() -
close
public void close()Close the underlying iterators if auto-closeable. Note that when Exception is thrown from any iterator in the for loop on closing, remaining iterators possibly left unclosed.- Specified by:
closein interfaceAutoCloseable
-