Class LazyIterablesConcatenator<T>

java.lang.Object
org.apache.sshd.common.util.helper.LazyIterablesConcatenator<T>
Type Parameters:
T - Type of element being iterared
All Implemented Interfaces:
Iterable<T>

public class LazyIterablesConcatenator<T> extends Object implements Iterable<T>
Creates a "smooth" wrapping Iterable using several underlying ones to provide the values. The "lazy" denomination is due to the fact that no iterable is consulted until the one(s) before it have been fully exhausted.
  • Field Details

  • Constructor Details

    • LazyIterablesConcatenator

      public LazyIterablesConcatenator(Iterable<? extends Iterable<? extends T>> iterables)
  • Method Details

    • getIterables

      public Iterable<? extends Iterable<? extends T>> getIterables()
    • iterator

      public Iterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • lazyConcatenateIterables

      public static <T> Iterable<T> lazyConcatenateIterables(Iterable<? extends Iterable<? extends T>> iterables)
      Type Parameters:
      T - Type if iterated element
      Parameters:
      iterables - The iterables to concatenate - ignored if null
      Returns:
      An Iterable that goes over all the elements in the wrapped iterables one after the other. The denomination "lazy" indicates that no iterable is consulted until the previous one has been fully exhausted.