EmptyLinkedList<E extends LinkedListEntry<E>> class

An empty linked list that doesn't allow adding-operations (like add). Removing-operations (like remove and clear) are ok, because the don't modify the contents of an empty linked list.

Inheritance

Constructors

EmptyLinkedList()
const

Properties

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

Methods

add(E entry) → void
Throws an UnsupportedError; operations that add to the collection are disallowed.
addAll(Iterable<E> entries) → void
Throws an UnsupportedError; operations that add to the collection are disallowed.
addFirst(E entry) → void
Throws an UnsupportedError; operations that add to the collection are disallowed.
clear() → void
Does nothing; because this collection is already empty.
remove(E entry) → bool
Always returns false; because value is guaranteed not to be contained in an empty collection.
any(bool f(E element)) → bool
Checks whether any element of this iterable satisfies test. [...]
inherited
cast<R>() → Iterable<R>
Returns itself; because this is already an empty iterable.
inherited
contains(Object element) → bool
Returns true if the collection contains an element equal to element. [...]
inherited
elementAt(int index) → E
Throws a RangeError.
inherited
every(bool f(E element)) → bool
Returns true; because an empty iterable doesn't have an element for which the predicate could return false.
inherited
expand<T>(Iterable<T> f(E element)) → Iterable<T>
Returns itself; because this is already an empty iterable. So there is nothing to expand.
inherited
firstWhere(bool test(E element), { E orElse() }) → E
Returns the result of orElse if such a function is provided. Throws an StateError otherwise.
inherited
fold<T>(T initialValue, T combine(T previousValue, E element)) → T
Returns initialValue; because there is nothing to combine.
inherited
followedBy(Iterable<E> other) → Iterable<E>
Returns other; because this Iterator is empty.
inherited
forEach(void f(E element)) → void
Applies the function f to each element of this collection in iteration order.
inherited
join([String separator = "" ]) → String
Returns an empty string.
inherited
lastWhere(bool test(E element), { E orElse() }) → E
Returns the result of orElse if such a function is provided. Throws an StateError otherwise.
inherited
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.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
reduce(E combine(E value, E element)) → E
Throws a StateError; because there is no element available.
inherited
singleWhere(bool test(E element), { E orElse() }) → E
Throws a StateError; because there is no such element.
inherited
skip(int count) → Iterable<E>
Throws a RangeError if count is negative. Returns itself otherwise; because this is already an empty iterable.
inherited
skipWhile(bool test(E value)) → Iterable<E>
Returns itself; because this is already an empty iterable.
inherited
take(int count) → Iterable<E>
Throws a RangeError if count is negative. Returns itself otherwise; because this is already an empty iterable.
inherited
takeWhile(bool test(E value)) → Iterable<E>
Returns itself; because this is already an empty iterable.
inherited
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)
inherited
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.
inherited
toString() → String
Returns a string representation of this object.
inherited
where(bool f(E element)) → Iterable<E>
Returns itself; because this is already an empty iterable.
inherited
whereType<T>() → Iterable<T>
Returns itself; because this is already an empty iterable.
inherited

Operators

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