Class ForwardingIterator<T>

  • Type Parameters:
    T - the type of the iterable
    All Implemented Interfaces:
    java.lang.Iterable<T>

    public final class ForwardingIterator<T>
    extends java.lang.Object
    implements java.lang.Iterable<T>
    An iterable that forwards the iterator() and spliterator() calls to some suppliers.
    Since:
    4.9.0
    • Constructor Summary

      Constructors 
      Constructor Description
      ForwardingIterator​(@NotNull java.util.function.Supplier<java.util.Iterator<T>> iterator, @NotNull java.util.function.Supplier<java.util.Spliterator<T>> spliterator)
      Creates a new forwarding iterable.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @NotNull java.util.Iterator<T> iterator()  
      @NotNull java.util.Spliterator<T> spliterator()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach
    • Constructor Detail

      • ForwardingIterator

        public ForwardingIterator​(@NotNull
                                  @NotNull java.util.function.Supplier<java.util.Iterator<T>> iterator,
                                  @NotNull
                                  @NotNull java.util.function.Supplier<java.util.Spliterator<T>> spliterator)
        Creates a new forwarding iterable.
        Parameters:
        iterator - the iterator supplier
        spliterator - the spliterator supplier
        Since:
        4.9.0
    • Method Detail

      • iterator

        @NotNull
        public @NotNull java.util.Iterator<T> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<T>
      • spliterator

        @NotNull
        public @NotNull java.util.Spliterator<T> spliterator()
        Specified by:
        spliterator in interface java.lang.Iterable<T>