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>

public class LazyMultiIterator<T> extends AbstractSplitableIterator<T>
  • 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

      public T next()
    • isSplitAllowed

      public boolean isSplitAllowed()
      Description copied from interface: SplitableIterator
      Tests to determine if this Iterator is capable of splitting into two new Iterators.
    • splitIterator

      @Nonnull public SplitIterator<T> splitIterator()
      Description copied from interface: SplitableIterator
      Whenever 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