new DataMap() → {platypus.DataMap}
This class defines a generic iterable data object. It behaves similarly to Map but maintains a list of keys as an Array. It includes recycle methods to encourage reuse.
- Source:
Methods
(static) recycle(dataMap)
Returns DataMap back to the cache. Prefer the DataMap's recycle method since it recycles property objects as well.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
dataMap |
platypus.DataMap
|
The DataMap to be recycled. |
(static) setUp() → {platypus.DataMap}
Returns DataMap from cache or creates a new one if none are available.
- Source:
delete(key) → {any}
Deletes a key (and value) from the DataMap.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
key |
String
|
The key to delete from the DataMap. |
Returns:
- Type:
-
any
value The value of the key is returned.
get(key) → {any}
Returns the value of the provided key.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
key |
String
|
The key to lookup. |
Returns:
- Type:
-
any
value The value of the provded key.
has(key) → {Boolean}
Determines whether the provided key is available on this DataMap.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
key |
String
|
The key to lookup. |
Returns:
- Type:
-
Boolean
value Whether the key is listed in this DataMap.
set(key, value) → {any}
Sets a value to a key in the DataMap.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
key |
String
|
The key to associate with the provided value. |
value |
any
|
The value to be stored by the DataMap. |
Returns:
- Type:
-
any
value The value passed in is returned for chaining.
toJSON() → {Object}
Returns a JSON object describing the component.
- Source:
Returns:
- Type:
-
Object
Returns a JSON definition that can be used to recreate the component.