Constructor
new MultiMap(valuesopt)
Constructor.
Name | Type | Attributes | Description |
---|---|---|---|
values | * | <optional> | an object who's enumerable properties will be added to this map |
- Source
Methods
add(key, value) → {module:util~MutliMap}
Add a value.
This method will append values to existing keys.
Name | Type | Description |
---|---|---|
key | string | the key to use |
value | * | the value to add; if |
- Source
this object
- Type:
- module:util~MutliMap
clear() → {module:util~MutliMap}
Remove all properties from this map.
- Source
this object
- Type:
- module:util~MutliMap
containsKey(key) → {boolean}
Test if there are any values associated with a key.
Name | Type | Description |
---|---|---|
key | string | the key to test |
- Source
true
if there is at least one value associated with the key
- Type:
- boolean
firstValue(key) → {*}
Get the first avaialble value assocaited with a key.
Name | Type | Description |
---|---|---|
key | string | the key of the value to get |
- Source
the first available value associated with the key, or undefined
if not available
- Type:
- *
isEmpty() → {boolean}
Test if the map is empty.
- Source
true
if there are no entries in this map
- Type:
- boolean
keySet() → {Array.<string>}
Get an array of all keys in this map.
- Source
array of keys in this map, or an empty array if the map is empty
- Type:
- Array.<string>
put(key, value) → {module:util~MutliMap}
Set a value.
This method will replace any existing values with just value
.
Name | Type | Description |
---|---|---|
key | string | the key to use |
value | * | the value to set; if |
- Source
this object
- Type:
- module:util~MutliMap
putAll(values) → {module:util~MutliMap}
Set multiple values.
This method will replace any existing values with those provided on values
.
Name | Type | Description |
---|---|---|
values | * | an object who's enumerable properties will be added to this map |
- Source
this object
- Type:
- module:util~MutliMap
remove(key) → {Array.<object>}
Remove all values associated with a key.
Name | Type | Description |
---|---|---|
key | string | the key of the values to remove |
- Source
the removed values, or undefined
if no values were present for the given key
- Type:
- Array.<object>
size() → {number}
Get the number of entries in this map.
- Source
the number of entries in the map
- Type:
- number
value(key) → {Array.<object>}
Get the values associated with a key.
Name | Type | Description |
---|---|---|
key | string | the key of the values to get |
- Source
the array of values associated with the key, or undefined
if not available
- Type:
- Array.<object>