HashSet
A mutable hash set containing one element from each group of equal elements.
Elements must retain stable equality and hash codes while stored. Nullable element types may store null, which hashes to zero. Generic floating equality coalesces NaNs and distinguishes positive and negative zero. User equality and hashing callbacks retain their effects and exceptions.
Iteration order is unspecified. Read-only Set aliases observe mutations. Adding a new element, removing an existing element or clearing a non-empty set invalidates existing iterators; adding a duplicate does not. Storage and traversal use ordinary Guest heap and instruction budgets.
Parameters
requested backing-map bucket capacity, not the initial size or an element limit.
Type Parameters
element type.
See also
Throws
if initialCapacity is negative or greater than 1,073,741,824.
Constructors
Properties
Functions
Checks whether this collection contains at least one element.
Creates a new mutable iterator over this set in unspecified order.
Appends non-null transformed elements to destination in iteration order.
Numeric accumulation traverses once in iteration order without an intermediate collection. Empty iterables return positive numeric zero. Integer arithmetic wraps at the result width; Float/Double addition retains ordinary rounding, infinities and NaN. Byte/Short widen to Int; UByte/UShort widen to UInt. Iterator failures propagate unchanged.
Sums selector once per element in iteration order, returning Double zero when empty. No collection is allocated; selector/iterator exceptions and inline non-local returns propagate. Addition retains ordinary Double rounding, infinities and NaN.
Sums selector once per element in iteration order, returning Int zero when empty. No collection is allocated; selector/iterator exceptions and inline non-local returns propagate. Addition uses ordinary wrapping Int arithmetic.
Sums selector once per element in iteration order, returning Long zero when empty. No collection is allocated; selector/iterator exceptions and inline non-local returns propagate. Addition uses ordinary wrapping Long arithmetic.
Sums selector once per element in iteration order, returning UInt zero when empty. No collection is allocated; selector/iterator exceptions and inline non-local returns propagate. Addition uses ordinary wrapping UInt arithmetic.
Sums selector once per element in iteration order, returning ULong zero when empty. No collection is allocated; selector/iterator exceptions and inline non-local returns propagate. Addition uses ordinary wrapping ULong arithmetic.