Class 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.
    Author:
    Apache MINA SSHD Project
    • Constructor Detail

      • LazyIterablesConcatenator

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

      • 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.