Class TransformIterator<S,T>

java.lang.Object
org.javimmutable.collections.iterators.AbstractSplitableIterator<T>
org.javimmutable.collections.iterators.TransformIterator<S,T>
All Implemented Interfaces:
Iterator<T>, SplitableIterator<T>

@Immutable public class TransformIterator<S,T> extends AbstractSplitableIterator<T>
  • Method Details

    • of

      public static <S, T> TransformIterator<S,T> of(@Nonnull SplitableIterator<S> source, @Nonnull java.util.function.Function<S,T> transforminator)
    • 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