EmptyIterable<E> class

Implementers

Constructors

EmptyIterable()
const

Properties

first → E
Throws a StateError; because there is no such element.
read-only
isEmpty → bool
Returns true if there are no elements in this collection. [...]
read-only
isNotEmpty → bool
Returns true if there is at least one element in this collection. [...]
read-only
iterator → Iterator<E>
Returns an empty iterator.
read-only
last → E
Throws a StateError; because there is no such element.
read-only
length → int
Returns 0.
read-only
single → E
Throws a StateError; because there is no such element.
read-only
hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

any(bool f(E element)) → bool
Checks whether any element of this iterable satisfies test. [...]
cast<R>() → Iterable<R>
Returns itself; because this is already an empty iterable.
contains(Object element) → bool
Returns true if the collection contains an element equal to element. [...]
elementAt(int index) → E
Throws a RangeError.
every(bool f(E element)) → bool
Returns true; because an empty iterable doesn't have an element for which the predicate could return false.
expand<T>(Iterable<T> f(E element)) → Iterable<T>
Returns itself; because this is already an empty iterable. So there is nothing to expand.
firstWhere(bool test(E element), { E orElse() }) → E
Returns the result of orElse if such a function is provided. Throws an StateError otherwise.
fold<T>(T initialValue, T combine(T previousValue, E element)) → T
Returns initialValue; because there is nothing to combine.
followedBy(Iterable<E> other) → Iterable<E>
Returns other; because this Iterator is empty.
forEach(void f(E element)) → void
Applies the function f to each element of this collection in iteration order.
join([String separator = "" ]) → String
Returns an empty string.
lastWhere(bool test(E element), { E orElse() }) → E
Returns the result of orElse if such a function is provided. Throws an StateError otherwise.
map<T>(T f(E e)) → Iterable<T>
Returns itself; because an empty iterable is an empty iterable and i can't create type information with a const constructor anyway.
reduce(E combine(E value, E element)) → E
Throws a StateError; because there is no element available.
singleWhere(bool test(E element), { E orElse() }) → E
Throws a StateError; because there is no such element.
skip(int count) → Iterable<E>
Throws a RangeError if count is negative. Returns itself otherwise; because this is already an empty iterable.
skipWhile(bool test(E value)) → Iterable<E>
Returns itself; because this is already an empty iterable.
take(int count) → Iterable<E>
Throws a RangeError if count is negative. Returns itself otherwise; because this is already an empty iterable.
takeWhile(bool test(E value)) → Iterable<E>
Returns itself; because this is already an empty iterable.
toList({bool growable: true }) → List<E>
If growable is true (which is the default) new List.from(this, growable: true) is returned, otherwise an const EmptyList() which is more efficient than new List(0)
toSet() → Set<E>
The documentation says nothing about the behaviour of the resulting set, so an empty standard set is returned (new Set()) to which new elements can be added.
toString() → String
Returns a string representation of this object.
where(bool f(E element)) → Iterable<E>
Returns itself; because this is already an empty iterable.
whereType<T>() → Iterable<T>
Returns itself; because this is already an empty iterable.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited