Skip to content

IndexesSequence

Description

Initializes the sequence map with an identity function so each index maps to its own physical value.

The sequence stores physical indexes (numbers), so a write of an unchanged index is provably a no-op — skipUnchangedWrites is always on, which also preserves the compact identity representation when an identity value is re-written.

Methods

destroy

Source code

indexesSequence.destroy()

Destroys the map instance.

getLength

Source code

indexesSequence.getLength() ⇒ number

Get length of the sequence.

getValueAtIndex

Source code

indexesSequence.getValueAtIndex(index) ⇒ T | undefined

Get the physical index at the given position.

ParamTypeDescription
indexnumberPosition in the sequence.

getValues

Source code

indexesSequence.getValues() ⇒ Array<number>

Get sequence of physical indexes.

Returns: Array<number> - Physical indexes.

setValueAtIndex

Source code

indexesSequence.setValueAtIndex(index, value) ⇒ boolean

Set the physical index at a single position. Materializes the sequence first.

ParamTypeDescription
indexnumberThe position.
value*The physical index to store.

setValues

Source code

indexesSequence.setValues(values)

Set a completely new sequence. Detects the identity case to keep the compact representation.

ParamTypeDescription
valuesArrayList of physical indexes.