BitSet
sealed class BitSetimport BitSet from Wax;A compact collection of Boolean values stored as bits.
Inherits from object. Follow these links for inherited members.
Members
constructorconstructor
public constructor (int32 capacity)Creates a fixed number of initially clear bits. Negative capacity panics; zero capacity is valid.
sizegetter
public get size() : int32The logical number of bits, not the number of set bits or backing words.
Setmethod
public fn Set(int32 index) : voidSets an in-range bit to true. Indices outside [0, size) panic.
Clearmethod
public fn Clear(int32 index) : voidSets an in-range bit to false. Indices outside [0, size) panic.
Getmethod
public fn Get(int32 index) : boolReads an in-range bit. Indices outside [0, size) panic.
Togglemethod
public fn Toggle(int32 index) : voidInverts an in-range bit. Indices outside [0, size) panic.
ClearAllmethod
public fn ClearAll() : voidClears every bit without changing the logical size.
PopCountmethod
public fn PopCount() : int32Counts bits currently set to true. An empty or fully clear bit set returns zero.