IterableX<T> extension

Extensions for Iterable.

on

Properties

hasOne bool

Available on Iterable<T>, provided by the IterableX extension

Returns true if length of this Iterable is 1.
no setter
isLengthEven bool

Available on Iterable<T>, provided by the IterableX extension

Whether length of this Iterable is even.
no setter
isLengthOdd bool

Available on Iterable<T>, provided by the IterableX extension

Whether length of this Iterable is odd.
no setter

Methods

count(bool test(T element)) int

Available on Iterable<T>, provided by the IterableX extension

Returns the number of elements matching the given test predicate.
ifEmpty(Iterable<T> value) Iterable<T>

Available on Iterable<T>, provided by the IterableX extension

Returns this Iterable if it's not empty, otherwise returns value.
mapToList<R>(R toElement(T e), {bool growable = false}) List<R>

Available on Iterable<T>, provided by the IterableX extension

Creates a List with all elements of this Iterable modified by toElement.
mapToListWhere<R>(R toElement(T e), bool test(T e), {bool growable = false}) List<R>

Available on Iterable<T>, provided by the IterableX extension

Creates a List with all elements of this Iterable that satisfy the predicate test and modified by toElement.
mapToSet<R>(R toElement(T e), {bool modifiable = false}) Set<R>

Available on Iterable<T>, provided by the IterableX extension

Creates a Set with all elements of this Iterable modified by toElement.
mapToSetWhere<R>(R toElement(T e), bool test(T e), {bool modifiable = false}) Set<R>

Available on Iterable<T>, provided by the IterableX extension

Creates a Set with all elements of this Iterable that satisfy the predicate test and modified by toElement.
toFixedList() List<T>

Available on Iterable<T>, provided by the IterableX extension

Creates a fixed-length List containing the elements of this Iterable.
toUnmodifiableList() List<T>

Available on Iterable<T>, provided by the IterableX extension

Creates an unmodifiable List containing the elements of this Iterable.
toUnmodifiableSet() Set<T>

Available on Iterable<T>, provided by the IterableX extension

Creates an unmodifiable Set containing the elements of this Iterable.