Class jsbeans.HashMap
Javascript implementation of java.util.HashMap.
An object that maps keys to values. A map cannot contain duplicate keys;
each key can map to at most one value.
Methods
boolean
containsKey
(
key
)
Returns true if this map contains a mapping for the specified {@param} key.
- Parameters:
-
key
<String>
- Returns:
boolean
Object
get
(
key
)
Returns the value to which the specified {@param} key is mapped, null if this map contains no mapping for the {@param} key.
- Parameters:
-
key
<String>
- Returns:
Object
Array<String>
keySet
(
)
Returns an Array view of the keys contained in this map.
void
order
(
[caseSensitive]
)
Orders the key-value mapping by value.
This method changes the actual order of elements in instance.
- Parameters:
-
[caseSensitive]
<boolean>
default true
- Returns:
void
void
orderByKey
(
[caseSensitive]
)
Orders the key-value mapping by key.
This method changes the actual order of elements in instance.
- Parameters:
-
[caseSensitive]
<boolean>
default true
- Returns:
void
void
orderByValue
(
[caseSensitive]
)
See {@method} order.
- Parameters:
-
[caseSensitive]
<boolean>
default true
- Returns:
void
Object
put
(
key
,
value
)
Associates the specified {@param} value with the specified {@param} key in this map
(optional operation). If the map previously contained a mapping for
the {@param} key, the old value is replaced by the specified {@param} value.
- Parameters:
-
key
<String>
-
value
<Object>
- Returns:
Object
- the previous value associated with
key, or null if there was no mapping for key.
Object
remove
(
key
)
Removes the mapping for the specified key from this map if present.
- Parameters:
-
key
<String>
key whose mapping is to be removed from the map
- Returns:
Object
- the previous value associated with
key, or
null if there was no mapping for key.
(A null return can also indicate that the map
previously associated null with key.)
Integer
size
(
)
Returns the number of key-value mappings in this map.
Array<Object>
values
(
)
Returns an Array view of the values contained in this map.