IndexMap

Map for storing mappings from an index to a value.

Methods

clear()

Clear all values to the defaults.

getLength(){number}

Get length of index map.

Returns: {number}

getValueAtIndex(index){*}

Get value for the particular index.

Parameters:
Name Type Description
index number

Index for which value is got.

Returns: {*}

getValues(){Array}

Get full list of values for particular indexes.

Returns: {Array}

setValueAtIndex(index, value){boolean}

Set new value for the particular index.

Parameters:
Name Type Description
index number

The index.

value *

The value to save.

Note: Please keep in mind that it is not possible to set value beyond the map (not respecting already set
map's size). Please use the setValues method when you would like to extend the map.
Note: Please keep in mind that change hook triggered by the method may not update cache of a collection immediately.

Returns: {boolean}

setValues(values)

Set new values for particular indexes.

Note: Please keep in mind that change hook triggered by the method may not update cache of a collection immediately.

Parameters:
Name Type Description
values Array

List of set values.

Class: IndexMap