Type class
A version of a Dictionary
that has a "template".
A template is an instance of an object, that can be used to create new elements in the list without actually needing to create instances for those.
When new element is created in the list, e.g. by calling its create()
method, an exact copy of the element is created (including properties and other attributes), inserted into the list and returned.
Sources
DictionaryTemplate can be used (imported) via one of the following packages.
/** * -------------------------------------------------------- * Import from: "core.ts" * Use like: am4core.DictionaryTemplate * -------------------------------------------------------- */ import * as am4core from "@amcharts/amcharts4/core";
/** * -------------------------------------------------------- * Include via: <script src="core.js"></script> * Access items like: am4.DictionaryTemplate * -------------------------------------------------------- */
Inheritance
DictionaryTemplate extends Dictionary
.
DictionaryTemplate is not extended by any other symbol.
Properties
events # |
Type Default Inherited from Event dispatcher. |
---|---|
template # |
Type A "template" object to copy all properties from when creating new list items. |
There is 1 inherited item currently hidden from this list. |
Methods
[Symbol.iterator]() |
Returns Inherited from Returns an ES6 iterator for the keys/values of the dictionary. |
---|---|
clear() |
Returns Inherited from Removes all items from the dictionary. |
constructor( t: ) |
Returns Constructor |
copyFrom( source: ) |
Returns Copies all elements from other dictionary. |
create( key: ) |
Returns Instantiates a new object of the specified type, adds it to specified |
each( f: ( key: ) |
Returns Inherited from Calls |
getKey( key: ) |
Returns Inherited from Returns the value for a specific key. |
hasKey( key: ) |
Returns Inherited from Returns |
insertKey( key: ) |
Returns Inherited from Inserts value at specific key. Will thrown an exception if the key already exists in the dictionary. |
iterator() |
Returns Inherited from Returns an interator that can be used to iterate through all items in the dictionary. |
removeKey( key: ) |
Returns Inherited from Removes value at specific |
setKey( key: ) |
Returns Inherited from 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. |
There are 9 inherited items currently hidden from this list. |
Events
#cleared |
Param { type: Inherited from Invoked when dictionary is cleared. |
---|---|
#insertKey |
Param { key: Inherited from Invoked when |
#removeKey |
Param { key: Inherited from Invoked when |
#removed |
Param { oldValue: Inherited from Invoked when an item is removed from the dictionary. |
#setKey |
Param { key: Inherited from Invoked when |
There are 5 inherited items currently hidden from this list. |
Adapters
DictionaryTemplate does not have any adapters.