union abstract method

  1. @override
EnumSet<T> union(
  1. Set<T> other
)
override

Creates a new EnumSet which contains all the elements of this set and other.

That is, the returned set contains all the elements of this EnumSet and all the elements of other.

enum Numbers { one, two, three; }

var set1 = EnumSet.of(Numbers.values, {Numbers.one, Numbers.two});
var set2 = EnumSet.of(Numbers.values, {Numbers.one, Numbers.three});

final unionSet1 = set1.union(set2);
print(unionSet1); // (Numbers.one, Numbers.two, Numbers.three)

final unionSet2 = set2.union(set1);
print(unionSet2); // (Numbers.one, Numbers.two, Numbers.three)

Implementation

@override
EnumSet<T> union(Set<T> other);