public class IterableUtil
extends java.lang.Object
Iterable
instancesConstructor and Description |
---|
IterableUtil() |
Modifier and Type | Method and Description |
---|---|
static <T> java.lang.Iterable<T> |
range(int start,
int count,
Func1<java.lang.Integer,T> selector)
Creates
Iterable which emits count values which are selected by selector function |
static <T> T[] |
toArray(java.lang.Iterable<T> iterable,
java.lang.Class<T> type)
Converts iterable to an array
|
static <T> java.util.List<T> |
toList(java.lang.Iterable<T> iterable)
Converts iterable to a list
|
public static <T> java.lang.Iterable<T> range(int start, int count, Func1<java.lang.Integer,T> selector)
Iterable
which emits count
values which are selected by selector
functionT
- the type of elements returned by the iteratorstart
- The start index of sequencecount
- The amount of items in sequenceselector
- The selector function for value in sequenceIterable
instance with specified itemspublic static <T> T[] toArray(java.lang.Iterable<T> iterable, java.lang.Class<T> type)
T
- the type of elements returned by the iteratoriterable
- Iterable to converttype
- Type of array itemspublic static <T> java.util.List<T> toList(java.lang.Iterable<T> iterable)
T
- the type of elements returned by the iteratoriterable
- Iterable to convert