ListMove<E> class

A namespace for functions that move a List's elements to other collections.

To access ListMove, call the MovableList.move extension method on a list.

Contract

A ConcurrentModificationError is thrown if a predicate modifies the list.

final foo = [1, 2, 3, 4, 5];
foo.move(where: foo.remove).toList(); // throws ConcurrentModificationError

See SetMove for moving a Set's elements.

Constructors

ListMove(List<E> _list, Predicate<E> _predicate)
Creates a ListMove with the given backing list and predicate.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

collect(Consume<E> consume) → void
Moves the list's elements that satisfy the predicate to consume.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toList() List<E>
Move the list's elements that satisfy the predicate to another List.
toSet() Set<E>
Move the list's elements that satisfy the predicate to a Set.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited