Class Map
Represents a Map of objects.
All Known Subclasses
HashMap , LinkedHashMap , SortedMap
Property Summary
Property Description EMPTY_MAP : Map Convenience variable, for an empty and immutable list. empty : Boolean (read-only)Identifies if this map is empty. length : Number (read-only)REturns the size of the map.
Constructor Summary
This class does not have a constructor, so you cannot create it directly.
Method Summary
Method Description clear ()Clears the map of all objects. containsKey (Object )Identifies if this map contains an element identfied by the specified key. containsValue (Object )Identifies if this map contains an element identfied by the specified value. entrySet ()Returns a set of the map’s entries. get (Object )Returns the object associated with the key or null. getLength ()REturns the size of the map. isEmpty ()Identifies if this map is empty. keySet ()Returns a set of the map’s keys. put (Object , Object )Puts the specified value into the map using the specified key to identify it. putAll (Map )Copies all of the objects inside the specified map into this map. remove (Object )Removes the object from the map that is identified by the key. size ()Returns the size of the map. values ()Returns a collection of the values contained in this map. values ()Returns a collection of the values contained in this map.
Methods inherited from class Object
assign , create , create , defineProperties , defineProperty , entries , freeze , fromEntries , getOwnPropertyDescriptor , getOwnPropertyNames , getOwnPropertySymbols , getPrototypeOf , hasOwnProperty , is , isExtensible , isFrozen , isPrototypeOf , isSealed , keys , preventExtensions , propertyIsEnumerable , seal , setPrototypeOf , toLocaleString , toString , valueOf , values
Property Details
EMPTY_MAP
EMPTY_MAP: Map
Convenience variable, for an empty and immutable list.
empty
empty: Boolean (read-only)
Identifies if this map is empty.
length
length: Number (read-only)
REturns the size of the map. This is a bean attribute method and
supports the access to the collections
length similar to a ECMA array, such as 'products.length'.
Method Details
clear()
clear(): void
Clears the map of all objects.
containsKey(Object)
containsKey(key: Object ): Boolean
Identifies if this map contains an element identfied
by the specified key.
Parameters:
Returns:
true if this map contains an element whose key is
equal to the specified key.
containsValue(Object)
containsValue(value: Object ): Boolean
Identifies if this map contains an element identfied
by the specified value.
Parameters:
value - the value to use.
Returns:
true if this map contains an element whose value is
equal to the specified value.
entrySet()
entrySet(): Set
Returns a set of the map's entries. The returned set is actually a view to the entries of this map.
Returns:
a set of the map's entries.
get(Object)
get(key: Object ): Object
Returns the object associated with the key or null.
Parameters:
Returns:
the object associated with the key or null.
getLength()
getLength(): Number
REturns the size of the map. This is a bean attribute method and
supports the access to the collections
length similar to a ECMA array, such as 'products.length'.
Returns:
the number of objects in the map.
isEmpty()
isEmpty(): Boolean
Identifies if this map is empty.
Returns:
true if the map is empty, false otherwise.
keySet()
keySet(): Set
Returns a set of the map's keys. The returned set is actually a view to the keys of this map.
Returns:
put(Object, Object)
put(key: Object , value: Object ): Object
Puts the specified value into the map using the
specified key to identify it.
Parameters:
key - the key to use to identify the value.
value - the object to put into the map.
Returns:
previous value associated with specified key, or null if there was no mapping for key.
putAll(Map)
putAll(other: Map ): void
Copies all of the objects inside the specified map
into this map.
Parameters:
other - the map whose contents are copied into this map.
remove(Object)
remove(key: Object ): Object
Removes the object from the map that is identified by the key.
Parameters:
key - the key that identifies the object to remove.
Returns:
the removed object or null.
size()
size(): Number
Returns the size of the map.
Returns:
the number of objects in the map.
values() - Variant 1
values(): Collection
Returns a collection of the values contained in this map.
Returns:
a collection of the values contained in this map
API Version:
No longer available as of version 16.1.
Returns an independent modifiable collection holding all values.
values() - Variant 2
values(): Collection
Returns a collection of the values contained in this map.
Returns:
a collection of the values contained in this map
API Version:
Available from version 16.1.
Returns a view on the values of this map like keySet() and entrySet() do. Former version returned a shallow copy of this.