SetUtil class

Set algebra helpers ?union / intersection / difference / symmetric difference ?plus a few convenient constructors that preserve order via LinkedHashSet.

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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

difference<T>(Set<T> a, Set<T> b) → Set<T>
a minus b ?elements in a that are not in b.
from<T>(Iterable<T> source) → Set<T>
Build a LinkedHashSet from source, preserving iteration order.
fromMap<T, R>(Iterable<T> source, R transform(T)) → Set<R>
Build a LinkedHashSet from source, applying transform to each element first.
intersection<T>(Set<T> a, Set<T> b) → Set<T>
Intersection of a and b ?elements present in both sets.
removeWhere<T>(Set<T> source, bool test(T)) → int
Remove source elements that satisfy test. Returns the removed count.
symmetricDifference<T>(Set<T> a, Set<T> b) → Set<T>
Symmetric difference ?elements in either a or b but not both.
union<T>(Set<T> a, Set<T> b) → Set<T>
Union of a and b ?every element present in either set.