A collection of unique elements.

A `Set` is a `Collection` of its elements.

Sets may be the subject of the binary union, intersection, and complement operators `|`, `&`, and `~`.

    value kids = girls|boys;

Elements are compared for equality using `Object.equals()` or `Comparable.compare()`. An element may occur at most once in a set.

no type hierarchy

- `Set`
  - `Collection`
    - `Iterable`
      - `Category`

- `Set`
  - `emptySet`

Attributes
`hash` | Source Code `shared actual default Integer hash` The hash value of the value, which allows the value to be an element of a hash-based set or key of a hash-based map. Implementations must respect the constraint that: if `x==y` then `x.hash==y.hash`. Therefore, a class which refines `Object.equals()` must also refine `hash`. Refines `Object.hash`

Inherited Attributes
Attributes inherited from: `Object` `Object.string`
Attributes inherited from: `Collection<Element>` `Collection.string`
Attributes inherited from: `Iterable<Element,Absent>` `Iterable.coalesced`, `Iterable.cycled`, `Iterable.empty`, `Iterable.exceptLast`, `Iterable.first`, `Iterable.indexed`, `Iterable.last`, `Iterable.paired`, `Iterable.rest`, `Iterable.size`, `Iterable.string`

Methods
`clone` | Source Code `shared formal Set<Element> clone()` A shallow copy of this collection, that is, a collection with identical elements which does not change if this collection changes. If this collection is immutable, it is acceptable to return a reference to this collection. If this collection is mutable, a newly instantiated collection must be returned. Refines `Collection.clone`
`complement` | Source Code `shared formal Set<Element> complement<Other>(Set<Other> set) given Other satisfies Object` Returns a new `Set` containing all the elements in this set that are not contained in the given `Set`.
`contains` | Source Code `shared actual default Boolean contains(Object element)` The fundamental operation for `Set`s. Determines if the given value belongs to this set. Refines `Collection.contains` ultimately refines `Category.contains`
`equals` | Source Code `shared actual default Boolean equals(Object that)` Two `Set`s are considered equal if they have the same size and if every element of the first set is also an element of the second set, as determined by `contains()`. Equivalently, a set is equal to a second set if it is both a subset and a superset of the second set. Refines `Object.equals`
`exclusiveUnion` | Source Code `shared formal Set<Element|Other> exclusiveUnion<Other>(Set<Other> set) given Other satisfies Object` Returns a new `Set` containing only the elements contained in either this set or the given `Set`, but no element contained in both sets.
`intersection` | Source Code `shared formal Set<Element&Other> intersection<Other>(Set<Other> set) given Other satisfies Object` Returns a new `Set` containing only the elements that are present in both this set and the given `Set`.
`subset` | Source Code `shared default Boolean subset(Set<Object> set)` Determines if this set is a subset of the given `Set`, that is, if the given set contains all of the elements in this set.
`superset` | Source Code `shared default Boolean superset(Set<Object> set)` Determines if this set is a superset of the given `Set`, that is, if this set contains all of the elements in the given set.
`union` | Source Code `shared formal Set<Element|Other> union<Other>(Set<Other> set) given Other satisfies Object` Returns a new `Set` containing all the elements of this set and all the elements of the given `Set`.

Inherited Methods
Methods inherited from: `Category<Element>` `Category.contains()`, `Category.containsAny()`, `Category.containsEvery()`
Methods inherited from: `Collection<Element>` `Collection.clone()`
Methods inherited from: `Iterable<Element,Absent>` `Iterable.any()`, `Iterable.by()`, `Iterable.chain()`, `Iterable.collect()`, `Iterable.count()`, `Iterable.defaultNullElements()`, `Iterable.every()`, `Iterable.filter()`, `Iterable.find()`, `Iterable.findLast()`, `Iterable.flatMap()`, `Iterable.fold()`, `Iterable.follow()`, `Iterable.getFromFirst()`, `Iterable.interpose()`, `Iterable.iterator()`, `Iterable.longerThan()`, `Iterable.map()`, `Iterable.max()`, `Iterable.partition()`, `Iterable.product()`, `Iterable.reduce()`, `Iterable.repeat()`, `Iterable.scan()`, `Iterable.select()`, `Iterable.sequence()`, `Iterable.shorterThan()`, `Iterable.skip()`, `Iterable.skipWhile()`, `Iterable.sort()`, `Iterable.spread()`, `Iterable.take()`, `Iterable.takeWhile()`