UnionSet<E> constructor

UnionSet<E>(Set<Set<E>> _sets, { bool disjoint: false })

Creates a new set that's a view of the union of all sets in sets.

If any sets in sets change, this UnionSet reflects that change. If a new set is added to sets, this UnionSet reflects that as well.

If disjoint is true, then all component sets must be disjoint. That is, that they contain no elements in common. This makes many operations including length more efficient. If the component sets turn out not to be disjoint, some operations may behave inconsistently.

Implementation

UnionSet(this._sets, {bool disjoint: false}) : _disjoint = disjoint;