← Standard library

BitSet

sealed class BitSet
import BitSet from Wax;

A compact collection of Boolean values stored as bits.

BitSet.wax:7

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.

BitSet.wax:23

sizegetter

public get size() : int32

The logical number of bits, not the number of set bits or backing words.

BitSet.wax:36

Setmethod

public fn Set(int32 index) : void

Sets an in-range bit to true. Indices outside [0, size) panic.

BitSet.wax:49

Clearmethod

public fn Clear(int32 index) : void

Sets an in-range bit to false. Indices outside [0, size) panic.

BitSet.wax:59

Getmethod

public fn Get(int32 index) : bool

Reads an in-range bit. Indices outside [0, size) panic.

BitSet.wax:69

Togglemethod

public fn Toggle(int32 index) : void

Inverts an in-range bit. Indices outside [0, size) panic.

BitSet.wax:79

ClearAllmethod

public fn ClearAll() : void

Clears every bit without changing the logical size.

BitSet.wax:89

PopCountmethod

public fn PopCount() : int32

Counts bits currently set to true. An empty or fully clear bit set returns zero.

BitSet.wax:98