Dart API Referencedart:coreSet<E>

Set<E> Interface

This class is the public interface of a set. A set is a collection without duplicates.

Default class

HashSetImplementation<E>

Extends

Collection<E>

Subinterfaces

HashSet<E>

Constructors

Code new Set.from(Iterable<E> other) #

Creates a Set that contains all elements of other.

Set.from(Iterable<E> other);

Code new Set() #

Set();

Methods

Code void add(E value) #

Adds value into the set. The method has no effect if value was already in the set.

void add(E value);

Code void addAll(Collection<E> collection) #

Adds all the elements of the given collection to the set.

void addAll(Collection<E> collection);

Code void clear() #

Removes all elements in the set.

void clear();

Code bool contains(E value) #

Returns true if value is in the set.

bool contains(E value);

Code bool containsAll(Collection<E> collection) #

Returns true if this collection contains all the elements of collection.

bool containsAll(Collection<E> collection);

Code Set<E> intersection(Collection<E> other) #

Returns a new set which is the intersection between this set and the given collection.

Set<E> intersection(Collection<E> other);

Code bool isSubsetOf(Collection<E> collection) #

Returns true if collection contains all the elements of this collection.

bool isSubsetOf(Collection<E> collection);

Code bool remove(E value) #

Removes value from the set. Returns true if value was in the set. Returns false otherwise. The method has no effect if value value was not in the set.

bool remove(E value);

Code void removeAll(Collection<E> collection) #

Removes all the elements of the given collection from the set.

void removeAll(Collection<E> collection);