Type class
A Dictionary is collection where values of some type can be mapped to string keys.
You might call it an "associative list" or "associative array".
Sources
Dictionary can be used (imported) via one of the following packages.
// Dictionary is available in all of the following modules. // You only need to import one of them. /** * -------------------------------------------------------- * Import from: "core.ts" * Use like: am4core.Dictionary * -------------------------------------------------------- */ import * as am4core from "@amcharts/amcharts4/core";
// Dictionary is available in all of the following modules. // You only need to import one of them. /** * -------------------------------------------------------- * Include via: <script src="core.js"></script> * Access items like: am4.Dictionary * -------------------------------------------------------- */
Inheritance
Dictionary does not extend any other symbol.
Dictionary is extended by DictionaryTemplate
.
Properties
events # |
Type Default Event dispatcher. |
---|
Methods
[Symbol.iterator]() |
Returns Returns an ES6 iterator for the keys/values of the dictionary. |
---|---|
clear() |
Returns Removes all items from the dictionary. |
constructor() |
Returns Constructor |
copyFrom( source: ) |
Returns Copies items from another Dictionary. |
each( f: ( key: ) |
Returns Calls |
getKey( key: ) |
Returns Returns the value for a specific key. |
hasKey( key: ) |
Returns Returns |
insertKey( key: ) |
Returns Inserts value at specific key. Will thrown an exception if the key already exists in the dictionary. |
iterator() |
Returns Returns an interator that can be used to iterate through all items in the dictionary. |
removeKey( key: ) |
Returns Removes value at specific |
setKey( key: ) |
Returns Adds or updates key/value into dictionary. If the key already exists, the old value will be overwritten. If the new value is exactly the same as the old value (using ===), it won't do anything. |
Events
#cleared |
Param { type: Invoked when dictionary is cleared. |
---|---|
#insertKey |
Param { key: Invoked when |
#removeKey |
Param { key: Invoked when |
#removed |
Param { oldValue: Invoked when an item is removed from the dictionary. |
#setKey |
Param { key: Invoked when |
Adapters
Dictionary does not have any adapters.