Library / Collections / Sequences / Set
Set
Set is a thin pure-Envzn wrapper over a Dictionary
Fields 1
int64 lengthConstructors 4
INIT()No hasher — the backing dictionary CREATEs a DefaultHasher[V].
INIT(Hasher[V] h)
Caller-supplied hasher, threaded into the backing dictionary.
INIT(GrowthHint hint, int64 initialCapacity)
Default hasher + sizing hints (forwarded to the dictionary).
INIT(Hasher[V] h, GrowthHint hint, int64 initialCapacity)
Caller hasher + sizing hints.
Methods 12
METHOD clone() RETURNS Set[V, H]reads
Deep copy — the backing dictionary clones every key.
METHOD iterator() RETURNS ReferenceIterator[V]reads
ITERATOR — yields the elements (the dictionary's keys).
METHOD isEmpty() RETURNS booleanreads
METHOD size() RETURNS int64reads
Number of elements currently stored. Read-only, O(1).
MODIFY METHOD clear() RETURNS voidmodifies
MODIFY METHOD add(V value) RETURNS STATUSmodifies
ADD / REMOVE / CONTAINS
Add value (consumed). If already present, the element stays and
the moved-in value is dropped; .length is unchanged.
MODIFY METHOD addCopy(REFERENCE V value) RETURNS STATUSmodifies
Deep-copy form of add. value stays valid for the caller.
METHOD contains(REFERENCE V value) RETURNS booleanreads
MODIFY METHOD remove(REFERENCE V value) RETURNS STATUSmodifies
Remove value. SUCCESS if it was a member, FAILURE otherwise.
METHOD unionWith(REFERENCE Set[V, H] other) RETURNS Set[V, H]reads
SET ALGEBRA — |+| / |&| / |-| bind to these.
Union — every element from either input (deduped).
METHOD intersectionWith(REFERENCE Set[V, H] other) RETURNS Set[V, H]reads
Intersection — elements present in BOTH inputs.
METHOD differenceWith(REFERENCE Set[V, H] other) RETURNS Set[V, H]reads
Difference — elements in SELF but NOT in other (asymmetric).