Class LazyMultiIterator<T>
java.lang.Object
org.javimmutable.collections.iterators.AbstractSplitableIterator<T>
org.javimmutable.collections.iterators.LazyMultiIterator<T>
- All Implemented Interfaces:
Iterator<T>,SplitableIterator<T>
-
Method Summary
Modifier and TypeMethodDescriptionbooleanhasNext()booleanTests to determine if this Iterator is capable of splitting into two new Iterators.static <T> LazyMultiIterator<T> iterator(Indexed<SplitableIterable<T>> source) static <T> LazyMultiIterator<T> iterator(SplitableIterator<SplitableIterable<T>> source) next()Whenever isSplitAllowed returns true this method can be used to create two new SplitableIterators that collectively visit all the same elements as this Iterator.static <S,T> LazyMultiIterator <T> transformed(Indexed<S> source, java.util.function.Function<S, SplitableIterable<T>> transforminator) Constructs an iterator that visits all of the values reachable from all of the SplitableIterables visited by source.static <S,T> LazyMultiIterator <T> transformed(SplitableIterator<S> source, java.util.function.Function<S, SplitableIterable<T>> transforminator) Constructs an iterator that visits all of the values reachable from all of the SplitableIterables visited by source.Methods inherited from class org.javimmutable.collections.iterators.AbstractSplitableIterator
spliteratorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Method Details
-
iterator
@Nonnull public static <T> LazyMultiIterator<T> iterator(@Nonnull Indexed<SplitableIterable<T>> source) -
iterator
@Nonnull public static <T> LazyMultiIterator<T> iterator(@Nonnull SplitableIterator<SplitableIterable<T>> source) -
transformed
public static <S,T> LazyMultiIterator<T> transformed(SplitableIterator<S> source, java.util.function.Function<S, SplitableIterable<T>> transforminator) Constructs an iterator that visits all of the values reachable from all of the SplitableIterables visited by source. All values are transformed using the provided method. -
transformed
public static <S,T> LazyMultiIterator<T> transformed(Indexed<S> source, java.util.function.Function<S, SplitableIterable<T>> transforminator) Constructs an iterator that visits all of the values reachable from all of the SplitableIterables visited by source. All values are transformed using the provided method. -
hasNext
public boolean hasNext() -
next
-
isSplitAllowed
public boolean isSplitAllowed()Description copied from interface:SplitableIteratorTests to determine if this Iterator is capable of splitting into two new Iterators. -
splitIterator
Description copied from interface:SplitableIteratorWhenever isSplitAllowed returns true this method can be used to create two new SplitableIterators that collectively visit all the same elements as this Iterator. Whenever isSplitAllowed returns false this method throws UnsupportedOperationException.- Returns:
- two new SplitableIterators spanning the same elements as this
-