Skip to content

BooleanMap

Description

Initializes the boolean map with a default value or factory (defaults to false).

Methods

destroy

Source code

booleanMap.destroy()

Destroys the map instance.

getLength

Source code

booleanMap.getLength() ⇒ number

Get the number of indexes.

getValueAtIndex

Source code

booleanMap.getValueAtIndex(index) ⇒ T | undefined

Get the boolean value at a physical index.

ParamTypeDescription
indexnumberPhysical index.

getValues

Source code

booleanMap.getValues() ⇒ Array<boolean>

Get the full list of boolean values. Returns the materialized array by reference (no per-call copy).

setValueAtIndex

Source code

booleanMap.setValueAtIndex(index, value) ⇒ boolean

Set the boolean value at a single physical index. Materializes the store on the first non-default write.

ParamTypeDescription
indexnumberPhysical index.
value*The value to set (coerced to boolean).

setValues

Source code

booleanMap.setValues(values)

Set new boolean values. Keeps the compact representation when all values equal the default.

ParamTypeDescription
valuesArrayList of boolean values.