Package com.macrofocus.common.collection
Class Iterables
java.lang.Object
com.macrofocus.common.collection.Iterables
Created by luc on 25/11/15.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
static interface
static class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <E> Iterable<E>
concatenate
(Iterable<? extends E>... iterables) static <E> Iterable<E>
concatenate
(List<Iterable<? extends E>> iterables) static <T> Iterable<T>
conditional
(Iterable<T> original, Iterables.Condition<? super T> condition) static <T,
C> Iterable<C> convert
(Iterable<T> original, Iterables.Converter<? super T, C> converter) static <T> Iterable<T>
static <T> Iterable<T>
forArray
(T... array) forIntArray
(int... array) static <E> E[]
static <E> Collection<E>
makeCollection
(Iterable<E> iter) static <E> List<E>
static <E> E[]
makeTypedArray
(Iterable<? extends E> iter, Class<E> type) Copies an iterable's elements into an array.static <T> Iterable<T>
-
Constructor Details
-
Iterables
public Iterables()
-
-
Method Details
-
forIntArray
-
forArray
-
exclude
-
nonNull
-
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
-
concatenate
-
makeList
-
makeCollection
-
makeArray
-
makeTypedArray
Copies an iterable's elements into an array. ToDo: This is compatible with Java, not sure about JavaScript- Parameters:
iter
- the iterable to copytype
- the type of the elements- Returns:
- a newly-allocated array into which all the elements of the iterable have been copied
-