IndexMap
Plugin: IndexMap
Description
Map for storing mappings from an index to a value.
Methods
clear
indexMap.clear()
Clear all values to the defaults.
destroy
indexMap.destroy()
Destroys the Map instance.
getLength
indexMap.getLength() ⇒ number
Get length of the index map.
getValueAtIndex
indexMap.getValueAtIndex(index) ⇒ *
Get value for the particular index.
| Param | Type | Description |
|---|---|---|
| index | number | Index for which value is got. |
getValues
indexMap.getValues() ⇒ Array
Get full list of values for particular indexes.
setValueAtIndex
indexMap.setValueAtIndex(index, value) ⇒ boolean
Set new value for the particular index.
| Param | 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. |
setValues
indexMap.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.
| Param | Type | Description |
|---|---|---|
| values | Array | List of set values. |