MutableMap
A modifiable collection that holds pairs of objects (keys and values) and supports efficiently retrieving the value corresponding to each key. Map keys are unique; the map holds only one value for each key.
Since Kotlin
1.0Parameters
the type of map keys. The map is invariant in its key type.
the type of map values. The mutable map is invariant in its value type.
Types
Represents a key/value pair held by a MutableMap.
Properties
Returns a MutableSet of all key/value pairs 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.
Functions
Returns true
if the map contains the specified key.
Returns true
if the map maps one or more keys to the specified value.
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 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.
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.
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.
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.