Class Iterables

java.lang.Object
com.macrofocus.common.collection.Iterables

public class Iterables extends Object
Created by luc on 25/11/15.
  • Constructor Details

    • Iterables

      public Iterables()
  • Method Details

    • forIntArray

      public static Iterable<Integer> forIntArray(int... array)
    • forArray

      public static <T> Iterable<T> forArray(T... array)
    • exclude

      public static <T> Iterable<T> exclude(Iterable<T> original, T value)
    • nonNull

      public static <T> Iterable<T> nonNull(Iterable<T> original)
    • conditional

      public static <T> Iterable<T> conditional(Iterable<T> original, Iterables.Condition<? super T> condition)
    • convert

      public static <T, C> Iterable<C> convert(Iterable<T> original, Iterables.Converter<? super T,C> converter)
    • concatenate

      @SafeVarargs public static <E> Iterable<E> concatenate(Iterable<? extends E>... iterables)
    • concatenate

      public static <E> Iterable<E> concatenate(List<Iterable<? extends E>> iterables)
    • makeList

      public static <E> List<E> makeList(Iterable<? extends E> iter)
    • makeCollection

      public static <E> Collection<E> makeCollection(Iterable<E> iter)
    • makeArray

      public static <E> E[] makeArray(Iterable<E> iter)
    • makeTypedArray

      @GwtIncompatible public static <E> E[] makeTypedArray(Iterable<? extends E> iter, Class<E> type)
      Copies an iterable's elements into an array. ToDo: This is compatible with Java, not sure about JavaScript
      Parameters:
      iter - the iterable to copy
      type - the type of the elements
      Returns:
      a newly-allocated array into which all the elements of the iterable have been copied