Class Iterables

java.lang.Object
org.jboss.weld.util.collections.Iterables

public final class Iterables extends Object
Static utility methods for Iterable.
Author:
Martin Kouba
  • Method Details

    • addAll

      public static <T> boolean addAll(Collection<T> target, Iterable<? extends T> iterable)
      Add all elements in the iterable to the collection.
      Parameters:
      target -
      iterable -
      Returns:
      true if the target was modified, false otherwise
    • concat

      public static <T> Iterable<T> concat(Iterable<? extends Iterable<? extends T>> iterables)
      Combine the iterables into a single one.
      Parameters:
      iterables -
      Returns:
      a single combined iterable
    • concat

      public static <T> Iterable<T> concat(Iterable<? extends T> a, Iterable<? extends T> b)
      Combine the iterables into a single one.
    • iterators

      public static <T> Iterator<Iterator<? extends T>> iterators(Iterable<? extends Iterable<? extends T>> iterables)
      Parameters:
      iterables -
      Returns:
      an iterator over iterators from the given iterable of iterables
    • transform

      public static <T, R> Iterable<R> transform(Iterable<T> iterable, Function<? super T,? extends R> function)
    • flatMap

      public static <T, R> Iterable<R> flatMap(Iterable<T> iterable, Function<? super T,? extends Iterable<? extends R>> function)
    • toMultiRowString

      public static <T> String toMultiRowString(Iterable<T> iterable)
      Parameters:
      iterable -
      Returns:
      See Also: