Dart API Referencedart:coreCollection<E>

Collection<E> Interface

The Collection interface is the public interface of all collections.

Extends

Iterable<E>

Subinterfaces

List<E>, Queue<E>, Set<E>

Methods

Code bool every(bool f(E element)) #

Returns true if every elements of this collection satisify the predicate f. Returns false otherwise.

bool every(bool f(E element));

Code Collection<E> filter(bool f(E element)) #

Returns a new collection with the elements of this collection that satisfy the predicate f.

An element satisfies the predicate f if f(element) returns true.

Collection<E> filter(bool f(E element));

Code void forEach(void f(E element)) #

Applies the function f to each element of this collection.

void forEach(void f(E element));

Code bool isEmpty() #

Returns true if there is no element in this collection.

bool isEmpty();

Code int get length() #

Returns the number of elements in this collection.

int get length();

Code Collection map(f(E element)) #

Returns a new collection with the elements f(e) for each element e of this collection.

Note on typing: the return type of f() could be an arbitrary type and consequently the returned collection's typeis Collection.

Collection map(f(E element));

Code bool some(bool f(E element)) #

Returns true if one element of this collection satisfies the predicate f. Returns false otherwise.

bool some(bool f(E element));