IterableBasics<E> extension
Utility extension methods for the native Iterable class.
- on
-
- Iterable<
E>
- Iterable<
Methods
-
all(
bool test(E)) → bool -
Available on Iterable<
Alias for IterableE> , provided by the IterableBasics extension.every
. -
average(
num value(E)) → num? -
Available on Iterable<
Returns the average of all the values in this iterable, as defined byE> , provided by the IterableBasics extensionvalue
. -
containsAll(
Iterable< E> other, {bool collapseDuplicates = true}) → bool -
Available on Iterable<
Returns true if every element inE> , provided by the IterableBasics extensionother
also exists inthis
. -
containsAny(
Iterable< E> other) → bool -
Available on Iterable<
ReturnsE> , provided by the IterableBasics extensiontrue
ifthis
contains at least one element also contained inother
. -
getRandom(
{int? seed}) → E? -
Available on Iterable<
Returns a random element ofE> , provided by the IterableBasics extensionthis
, ornull
ifthis
is empty. -
getRange(
int start, int end) → Iterable< E> -
Available on Iterable<
Returns an Iterable containing the firstE> , provided by the IterableBasics extensionend
elements ofthis
, excluding the firststart
elements. -
max(
Comparator< E> compare) → E? -
Available on Iterable<
Returns the greatest element ofE> , provided by the IterableBasics extensionthis
as ordered bycompare
, ornull
ifthis
is empty. -
maxBy(
Comparable sortKey(E)) → E? -
Available on Iterable<
Returns the element ofE> , provided by the IterableBasics extensionthis
with the greatest value forsortKey
, ornull
ifthis
is empty. -
min(
Comparator< E> compare) → E? -
Available on Iterable<
Returns the smallest element ofE> , provided by the IterableBasics extensionthis
as ordered bycompare
, ornull
ifthis
is empty. -
minBy(
Comparable sortKey(E)) → E? -
Available on Iterable<
Returns the element ofE> , provided by the IterableBasics extensionthis
with the least value forsortKey
, ornull
ifthis
is empty. -
none(
bool test(E)) → bool -
Available on Iterable<
ReturnsE> , provided by the IterableBasics extensiontrue
if no element ofthis
satisfiestest
. -
one(
bool test(E)) → bool -
Available on Iterable<
ReturnsE> , provided by the IterableBasics extensiontrue
if there is exactly one element ofthis
which satisfiestest
. -
sum(
num addend(E)) → num -
Available on Iterable<
Returns the sum of all the values in this iterable, as defined byE> , provided by the IterableBasics extensionaddend
.