IterableExt<E> extension
Extensions to Iterables
- on
-
- Iterable<
E> ?
- Iterable<
Properties
Methods
-
all(
Predicate< E> test) → bool -
Returns
true
if all elements match the given predicatetest
. -
asList(
) → List< E> -
Creates a fixed-length List containing the elements of this Iterable,
equivalent to
toList(growable: false)
. -
averageBy<
T extends num> (T selector(int index, E)) → double -
Returns an average of all values produced by
selector
function or double.nan if there are no elements. -
chunked(
int size) → Iterable< Iterable< E> > -
Return a new lazy iterable contains chunks of this collection each not exceeding the given
size
. -
flatMap<
T> (Transform< E, Iterable< f) → Iterable<T> >T> -
Return a new lazy Iterable of all elements yielded from results of transform
f
function being invoked on each element of original collection. -
flatMapIndexed<
T> (IndexedTransform< E, Iterable< f) → Iterable<T> >T> -
Return a new lazy Iterable of all elements yielded from results of transform
f
function being invoked on each element of original collection, providing sequential index of each element. -
flatMapToList<
T> (List< T> destination, Transform<E, Iterable< f) → List<T> >T> -
Appends to the give
destination
with the elements yielded from results of transformf
function being invoked on each element of original collection. -
flatMapToListIndexed<
T> (List< T> destination, IndexedTransform<E, Iterable< f) → List<T> >T> -
Appends to the give
destination
with the elements yielded from results of transformf
function being invoked on each element of original collection, providing sequential index of each element. -
flatMapToSet<
T> (Set< T> destination, Transform<E, Iterable< f) → Set<T> >T> -
Appends to the give
destination
with the elements yielded from results of transformf
function being invoked on each element of original collection. -
flatMapToSetIndexed<
T> (Set< T> destination, IndexedTransform<E, Iterable< f) → Set<T> >T> -
Appends to the give
destination
with the elements yielded from results of transformf
function being invoked on each element of original collection, providing sequential index of each element. -
foldIndexed<
S> (S initial, IndexedAccumulate< S, E> f) → S -
Accumulates a collection to a single value of type
S
, which starts from aninitial
value, by combining each element with the current accumulator value, with the combinatorf
, providing sequential index of the element. -
foldRight<
S> (S initial, ReversedAccumulate< S, E> f) → S -
Accumulates a collection to a single value of type
S
, which starts from aninitial
value, by combining each element with the current accumulator value, with the combinatorf
in a reversed order. -
foldRightIndexed<
S> (S initial, IndexedReversedAccumulate< S, E> f) → S -
Accumulates a collection to a single value, which starts from an
initial
value, by combining each element with the current accumulator value, with the combinatorf
in a reversed order, providing sequential index of the element. -
forEachIndexed(
IndexedAction< E> f) → void -
Applies the action
f
on each element, providing sequential index of the element. -
mapIndexed<
T> (IndexedTransform< E, T> f) → Iterable<T> -
Transforms each element to another object of type
T
, by applying the transformerf
, providing sequential index of the element. -
mapToList<
T> (List< T> destination, Transform<E, T> f) → List<T> -
Transforms elements to objects of type
T
with the transformerf
, and appends the result to the givendestination
. -
mapToListIndexed<
T> (List< T> destination, IndexedTransform<E, T> f) → List<T> -
Transforms elements to objects of type
T
with the transformerf
, providing sequential index of the element, and appends the result to the givendestination
. -
mapToSet<
T> (Set< T> destination, Transform<E, T> f) → Set<T> -
Transforms elements to objects of type
T
with the transformerf
, and appends the result to the givendestination
. -
mapToSetIndexed<
T> (Set< T> destination, IndexedTransform<E, T> f) → Set<T> -
Transforms elements to objects of type
T
with the transformerf
, providing sequential index of the element, and appends the result to the givendestination
. -
maxBy<
T extends Comparable< (Object> >T selector(int index, E)) → E? -
Returns the first element yielding the largest value of the given function or
null
if there are no elements. -
minBy<
T extends Comparable< (Object> >T selector(int index, E)) → E? -
Returns the first element yielding the smallest value of the given function or
null
if there are no elements. -
none(
Predicate< E> test) → bool -
Returns
true
if no elements match the given predicatetest
. -
partition(
Predicate< E> test) → Tuple2<Iterable< E> , Iterable<E> > -
Splits this collection into pair (
Tuple2
) of lazy iterables, whereitem1
contains elements for whichtest
yieldstrue
, whileitem2
contains elements for whichtest
yieldsfalse
. -
partitionIndexed(
IndexedPredicate< E> test) → Tuple2<Iterable< E> , Iterable<E> > -
Splits this collection into pair (
Tuple2
) of lazy iterables, whereitem1
contains elements for whichtest
yieldstrue
, whileitem2
contains elements for whichtest
yieldsfalse
, comparing to partition,test
will has access to the sequential index of each element. -
sumBy<
T extends num> (T selector(int index, E)) → T -
Returns the sum of all values produced by
selector
function applied to each element in the collection. -
whereIndexed(
IndexedPredicate< E> test) → Iterable<E> -
Returns a new lazy Iterable with all elements that satisfy the predicate
test
, providing sequential index of the element. -
whereNot(
Predicate< E> test) → Iterable<E> -
Returns a new lazy Iterable with all elements that does NOT satisfy the predicate
test
. -
whereNotIndexed(
IndexedPredicate< E> test) → Iterable<E> -
Returns a new lazy Iterable with all elements that does NOT satisfy the predicate
test
, providing sequential index of the element.