Class sap.ui2.srvc.Map
Defined in: utils.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Creates an empty map.
|
| Method Attributes | Method Name and Description |
|---|---|
|
containsKey(sKey)
Returns true if this map contains a mapping for the specified key.
|
|
|
get(sKey)
Returns the value to which the specified key is mapped, or
undefined if this map
contains no mapping for the key. |
|
|
keys()
Returns an array of this map's keys.
|
|
|
put(sKey, vValue)
Associates the specified value with the specified key in this map.
|
|
|
remove(sKey)
Removes a key together with its value from the map.
|
|
|
toString()
Returns this map's string representation.
|
Class Detail
sap.ui2.srvc.Map()
Creates an empty map. It is used for mapping from arbitrary string(!) keys (including "get" or
"hasOwnProperty") to values of any type.
- Since:
- 1.5.0
Method Detail
{boolean}
containsKey(sKey)
Returns true if this map contains a mapping for the specified key.
- Parameters:
- {string} sKey
- key whose presence in this map is to be tested
- Since:
- 1.5.0
- Returns:
- {boolean} true if this map contains a mapping for the specified key
{any}
get(sKey)
Returns the value to which the specified key is mapped, or
undefined if this map
contains no mapping for the key.
- Parameters:
- {string} sKey
- the key whose associated value is to be returned
- Since:
- 1.5.0
- Returns:
- {any} the value to which the specified key is mapped, or
undefinedif this map contains no mapping for the key
{string[]}
keys()
Returns an array of this map's keys. This array is a snapshot of the map; concurrent
modifications of the map while iterating do not influence the sequence.
- Since:
- 1.5.0
- Returns:
- {string[]} this map's keys
{any}
put(sKey, vValue)
Associates the specified value with the specified key in this map. If the map previously
contained a mapping for the key, the old value is replaced by the specified value. Returns
the old value. Note: It might be a good idea to assert that the old value is
undefined in case you expect your keys to be unique.
- Parameters:
- {string} sKey
- key with which the specified value is to be associated
- {any} vValue
- value to be associated with the specified key
- Since:
- 1.5.0
- Returns:
- {any} the old value
remove(sKey)
Removes a key together with its value from the map.
- Parameters:
- {string} sKey
- the map's key to be removed
- Since:
- 1.11.0
{string}
toString()
Returns this map's string representation.
- Since:
- 1.5.0
- Returns:
- {string} this map's string representation