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
indexesSequence.destroy()
Destroys the map instance.
getLength
indexesSequence.getLength() ⇒ number
Get length of the sequence.
getValueAtIndex
indexesSequence.getValueAtIndex(index) ⇒ T | undefined
Get the physical index at the given position.
| Param | Type | Description |
|---|---|---|
| index | number | Position in the sequence. |
getValues
indexesSequence.getValues() ⇒ Array<number>
Get sequence of physical indexes.
Returns: Array<number> - Physical indexes.
setValueAtIndex
indexesSequence.setValueAtIndex(index, value) ⇒ boolean
Set the physical index at a single position. Materializes the sequence first.
| Param | Type | Description |
|---|---|---|
| index | number | The position. |
| value | * | The physical index to store. |
setValues
indexesSequence.setValues(values)
Set a completely new sequence. Detects the identity case to keep the compact representation.
| Param | Type | Description |
|---|---|---|
| values | Array | List of physical indexes. |