new KeyValuePair()
An object that maps keys to values.
An object that maps keys to values. A map cannot contain duplicate keys. Each key can map to at most one value.
Note: This class replace the old system.data.Map
interface in the VEGAS framework. Today in Javascript the Map class is a standard global ECMAScript definition.
Members
-
<readonly> length :number
-
Returns the number of key-value mappings in this map.
Type:
- number
Methods
-
clear()
-
Removes all mappings from this map (optional operation).
-
clone()
-
Returns a shallow copy of the map.
Returns:
a shallow copy of the map.
-
delete(key)
-
The
delete()
method removes the specified element from a KeyValuePair object.Parameters:
Name Type Description key
* The key of the entry to remove.
-
forEach(callback, thisArg)
-
The forEach() method executes a provided function once per each key/value pair in the KeyValuePair object, in insertion order.
Parameters:
Name Type Description callback
Function to execute for each element.
thisArg
Value to use as this when executing callback.
-
get(key)
-
Returns the value to which this map maps the specified key.
Parameters:
Name Type Description key
* The key of the entry to retrieve in the collection.
-
has(key)
-
Returns
true
if this map contains a mapping for the specified key.Parameters:
Name Type Description key
* The key of the entry to retrieve in the collection.
Returns:
true
if this map contains a mapping for the specified key. -
hasValue()
-
Returns
true
if this map maps one or more keys to the specified value.Returns:
true
if this map maps one or more keys to the specified value. -
isEmpty()
-
Returns
true
if this map contains no key-value mappings.Returns:
true
if this map contains no key-value mappings. -
iterator()
-
Returns the values iterator of this map.
Returns:
the values iterator of this map.
-
keyIterator()
-
Returns the keys iterator of this map.
Returns:
the keys iterator of this map.
-
keys()
-
Returns an
Array
of all the keys in the map.Returns:
an
Array
representation of all the keys register in this collection. -
set(key, value)
-
Associates the specified value with the specified key in this map (optional operation).
Parameters:
Name Type Description key
* The key of the element to add to the Map object.
value
* The value of the element to add to the Map object.
-
setAll(map)
-
Copies all of the mappings from the specified map to this map (optional operation).
Parameters:
Name Type Description map
system.data.KeyValuePair The map to fill the current map.
-
toString()
-
Returns the string representation of this instance.
Returns:
the string representation of this instance.
-
values()
-
Returns an array of all the values in the map.
Returns:
an
Array
representation of all the values register in this collection.