HashMap
Hash table based implementation of the MutableMap interface.
This implementation makes no guarantees regarding the order of enumeration of keys, values and entries collections.
Since Kotlin
1.1Inheritors
Constructors
Creates a new empty HashMap.
Creates a new empty HashMap with the specified initial capacity.
Creates a new empty HashMap with the specified initial capacity and load factor.
Creates a new empty HashMap.
Creates a new empty HashMap with the specified initial capacity.
Creates a new empty HashMap with the specified initial capacity and load factor.
Creates a new empty HashMap.
Creates a new empty HashMap with the specified initial capacity.
Creates a new empty HashMap with the specified initial capacity and load factor.
Creates a new empty HashMap.
Creates a new empty HashMap with the specified initial capacity.
Creates a new empty HashMap with the specified initial capacity and load factor.
Properties
Returns a MutableSet of all key/value pairs in this map.
Returns a read-only Set of all key/value pairs in this map.
Returns a MutableSet of all key/value pairs in this map.
Returns a MutableSet of all key/value pairs in this map.
Returns a MutableSet of all key/value pairs in this map.
Returns a MutableSet of all keys in this map.
Returns a MutableSet of all keys in this map.
Returns a MutableSet of all keys in this map.
Returns a MutableSet of all keys in this map.
Returns a MutableCollection of all values in this map. Note that this collection may contain duplicate values.
Returns a MutableCollection of all values in this map. Note that this collection may contain duplicate values.
Returns a MutableCollection of all values in this map. Note that this collection may contain duplicate values.
Returns a MutableCollection of all values in this map. Note that this collection may contain duplicate values.
Functions
Returns true
if the map contains the specified key.
Returns true
if the map contains the specified key.
Returns true
if the map contains the specified key.
Returns true
if the map contains the specified key.
Returns true
if the map contains the specified key.
Returns true
if the map maps one or more keys to the specified value.
Returns true
if the map maps one or more keys to the specified value.
Returns true
if the map maps one or more keys to the specified value.
Returns true
if the map maps one or more keys to the specified value.
Returns true
if the map maps one or more keys to the specified value.
Compares this map with other instance with the ordered structural equality.
Returns a single list of all elements yielded from results of transform function being invoked on each entry of original map.
Returns a single list of all elements yielded from results of transform function being invoked on each entry of original map.
Appends all elements yielded from results of transform function being invoked on each entry of original map, to the given destination.
Appends all elements yielded from results of transform function being invoked on each entry of original map, to the given destination.
Returns the value corresponding to the given key, or null
if such a key is not present in the map.
Returns the value corresponding to the given key, or null
if such a key is not present in the map.
Returns the value corresponding to the given key, or null
if such a key is not present in the map.
Returns the value corresponding to the given key, or null
if such a key is not present in the map.
Returns the value corresponding to the given key, or defaultValue if such a key is not present in the map.
Returns the value corresponding to the given key, or defaultValue if such a key is not present in the map.
Returns the value corresponding to the given key, or defaultValue if such a key is not present in the map.
Returns the value corresponding to the given key, or defaultValue if such a key is not present in the map.
Returns the value corresponding to the given key, or defaultValue if such a key is not present in the map.
Returns the value to which the specified key is mapped, or defaultValue if this map contains no mapping for the key.
Returns the value for the given key or throws an exception if there is no such key in the map.
Returns the value of the property for the given object from this read-only map.
Returns the value of the property for the given object from this mutable map.
Returns true
if the map is empty (contains no elements), false
otherwise.
Returns true
if the map is empty (contains no elements), false
otherwise.
Returns true
if the map is empty (contains no elements), false
otherwise.
Returns true
if the map is empty (contains no elements), false
otherwise.
Returns a MutableIterator over the mutable entries in the MutableMap.
Populates the given destination map with entries having the keys obtained by applying the transform function to each entry in this Map and the values of this map.
Populates the given destination map with entries having the keys of this map and the values obtained by applying the transform function to each entry in this Map.
Returns the largest value among all values produced by selector function applied to each entry in the map.
Returns the largest value according to the provided comparator among all values produced by selector function applied to each entry in the map or null
if there are no entries.
Returns the first entry having the largest value according to the provided comparator or null
if there are no entries.
Returns the smallest value among all values produced by selector function applied to each entry in the map.
Returns the smallest value according to the provided comparator among all values produced by selector function applied to each entry in the map or null
if there are no entries.
Returns a map containing all entries of the original map except the entry with the given key.
Returns a map containing all entries of the original map except those entries the keys of which are contained in the given keys array.
Returns a map containing all entries of the original map except those entries the keys of which are contained in the given keys collection.
Returns a map containing all entries of the original map except those entries the keys of which are contained in the given keys sequence.
Removes the entry with the given key from this mutable map.
Removes all entries the keys of which are contained in the given keys array from this mutable map.
Removes all entries the keys of which are contained in the given keys collection from this mutable map.
Removes all entries from the keys of which are contained in the given keys sequence from this mutable map.
Returns the first entry having the smallest value according to the provided comparator or null
if there are no entries.
Creates a new read-only map by replacing or adding entries to this map from a given array of key-value pairs.
Creates a new read-only map by replacing or adding an entry to this map from a given key-value pair.
Creates a new read-only map by replacing or adding entries to this map from a given collection of key-value pairs.
Creates a new read-only map by replacing or adding entries to this map from another map.
Creates a new read-only map by replacing or adding entries to this map from a given sequence of key-value pairs.
Appends or replaces all pairs from the given array of pairs in this mutable map.
Appends or replaces the given pair in this mutable map.
Appends or replaces all pairs from the given collection of pairs in this mutable map.
Appends or replaces all entries from the given map in this mutable map.
Appends or replaces all pairs from the given sequence of pairs in this mutable map.
Updates this map with key/value pairs from the specified map from.
Updates this map with key/value pairs from the specified map from.
Updates this map with key/value pairs from the specified map from.
Updates this map with key/value pairs from the specified map from.
Puts all the given pairs into this MutableMap with the first component in the pair being the key and the second the value.
Puts all the elements of the given collection into this MutableMap with the first component in the pair being the key and the second the value.
Puts all the elements of the given sequence into this MutableMap with the first component in the pair being the key and the second the value.
Removes the specified key and its corresponding value from this map.
Removes the entry for the specified key only if it is mapped to the specified value.
Removes the specified key and its corresponding value from this map.
Removes the entry for the specified key only if it is mapped to the specified value.
Removes the specified key and its corresponding value from this map.
Removes the entry for the specified key only if it is mapped to the specified value.
Removes the specified key and its corresponding value from this map.
Removes the entry for the specified key only if it is mapped to the specified value.
Removes the specified key and its corresponding value from this map.
Returns a new read-only map containing all key-value pairs from the original map.
Populates and returns the destination mutable map with key-value pairs from the given map.
Returns a new mutable map containing all key-value pairs from the original map.
Converts this Map to a Properties object.
Converts this Map to a SortedMap. The resulting SortedMap determines the equality and order of keys according to their natural sorting order.
Converts this Map to a SortedMap. The resulting SortedMap determines the equality and order of keys according to the sorting order provided by the given comparator.
Returns a wrapper of this read-only map, having the implicit default value provided with the specified function defaultValue.
Returns a wrapper of this mutable map, having the implicit default value provided with the specified function defaultValue.