IterableExtension<T> extension
Methods
-
all(bool where(T))
→ bool
-
Returns
true
if every item matches where
-
associateBy<S>(S key(T))
→ Map<S, T>
-
Create a map by mapping every element using
key
. Duplicate values
are discarded
-
count(bool where(T))
→ int
-
Counts all elements for which
where
returns true
-
find(bool where(T))
→ T?
-
Finds the first item that matches
where
, if no such item could be found
returns null
-
forEachIndexed(dynamic f(int, T))
→ void
-
Same as
Iterable.foreach
except that the f
function also receives
the index of the item
-
mapIndexed<R>(R mapper(int, T))
→ Iterable<R>
-
Same as Iterable.map except that the
mapper
function also receives
the index of the item being mapped
-
mapNotNull<K>(K? mapper(T))
→ Iterable<K>
-
Maps every item in this iterable using
mapper
and
removes any null values emitted by mapper
-
split(bool on(T))
→ Tuple2<List<T>, List<T>>
-
Splits the elements according to
on
. Items for which on
is true will
be stored in Tuple2.item1
, other items in Tuple2.item2
-
sum<E extends num>(E valueProducer(T))
→ E
-
Sums the result of
valueProvider
for each item