Class CompositeIterable<T>

java.lang.Object
org.wildfly.common.iteration.CompositeIterable<T>
All Implemented Interfaces:
Iterable<T>

public class CompositeIterable<T> extends Object implements Iterable<T>
Used for iterating over an series of iterables, thus avoiding the need to allocate/populate a new list containing all elements. More efficient than the alternative when the number of iterables is arbitrary and small relative to the size of each iterable.
Author:
Paul Ferraro
  • Constructor Details

    • CompositeIterable

      @SafeVarargs public CompositeIterable(Iterable<? extends T>... iterables)
      Constructs a new composite iterable.
      Parameters:
      iterables - a series of iterables
    • CompositeIterable

      public CompositeIterable(List<? extends Iterable<? extends T>> iterables)
      Constructs a new composite iterable.
      Parameters:
      iterables - a series of iterables
  • Method Details