AbstractMutableMap

expect abstract class AbstractMutableMap<K, V> : MutableMap<K, V>

Provides a skeletal implementation of the MutableMap interface.

The implementor is required to implement entries property, which should return mutable set of map entries, and put function.

Since Kotlin

1.3
actual abstract class AbstractMutableMap<K, V> : AbstractMap<K, V> , MutableMap<K, V>

Provides a skeletal implementation of the MutableMap interface.

The implementor is required to implement entries property, which should return mutable set of map entries, and put function.

Since Kotlin

1.1
actual abstract class AbstractMutableMap<K, V> : AbstractMap<K, V> , MutableMap<K, V>

Provides a skeletal implementation of the MutableMap interface.

The implementor is required to implement entries property, which should return mutable set of map entries, and put function.

actual abstract class AbstractMutableMap<K, V> : AbstractMap<K, V> , MutableMap<K, V>

Provides a skeletal implementation of the MutableMap interface.

The implementor is required to implement entries property, which should return mutable set of map entries, and put function.

Since Kotlin

1.1

Parameters

K

the type of map keys. The map is invariant in its key type.

V

the type of map values. The map is invariant in its value type.

K

the type of map keys. The map is invariant in its key type.

V

the type of map values. The map is invariant in its value type.

K

the type of map keys. The map is invariant in its key type.

V

the type of map values. The map is invariant in its value type.

K

the type of map keys. The map is invariant in its key type.

V

the type of map values. The map is invariant in its value type.

Functions

clear
Link copied to clipboard
expect open override fun clear()
abstract fun clear()

Removes all elements from this map.

actual open override fun clear()

Removes all elements from this map.

actual open override fun clear()

Removes all elements from this map.

clone
Link copied to clipboard
open fun clone(): Any
compute
Link copied to clipboard
open fun compute(p0: K, p1: BiFunction<in K, in V?, out V?>): V?
computeIfAbsent
Link copied to clipboard
open fun computeIfAbsent(p0: K, p1: Function<in K, out V>): V
computeIfPresent
Link copied to clipboard
open fun computeIfPresent(p0: K, p1: BiFunction<in K, in V, out V?>): V?
containsKey
Link copied to clipboard
expect open override fun containsKey(key: K): Boolean
abstract fun containsKey(key: K): Boolean

Returns true if the map contains the specified key.

open override fun containsKey(key: K): Boolean

Returns true if the map contains the specified key.

open override fun containsKey(key: K): Boolean

Returns true if the map contains the specified key.

containsValue
Link copied to clipboard
expect open override fun containsValue(value: V): Boolean
abstract fun containsValue(value: V): Boolean

Returns true if the map maps one or more keys to the specified value.

open override fun containsValue(value: V): Boolean

Returns true if the map maps one or more keys to the specified value.

open override fun containsValue(value: V): Boolean

Returns true if the map maps one or more keys to the specified value.

equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Compares this map with other instance with the ordered structural equality.

open operator override fun equals(other: Any?): Boolean

Compares this map with other instance with the ordered structural equality.

forEach
Link copied to clipboard
open fun forEach(p0: BiConsumer<in K, in V>)
get
Link copied to clipboard
expect open operator override fun get(key: K): V?
abstract operator fun get(key: K): V?

Returns the value corresponding to the given key, or null if such a key is not present in the map.

open operator override fun get(key: K): V?

Returns the value corresponding to the given key, or null if such a key is not present in the map.

open operator override fun get(key: K): V?

Returns the value corresponding to the given key, or null if such a key is not present in the map.

getOrDefault
Link copied to clipboard
open fun getOrDefault(key: K, defaultValue: V): V

Returns the value corresponding to the given key, or defaultValue if such a key is not present in the map.

Since Kotlin

1.1
open fun getOrDefault(key: K, defaultValue: V): V

Returns the value corresponding to the given key, or defaultValue if such a key is not present in the map.

Since Kotlin

1.1
open fun getOrDefault(key: K, defaultValue: V): V

Returns the value corresponding to the given key, or defaultValue if such a key is not present in the map.

Since Kotlin

1.1
hashCode
Link copied to clipboard
open override fun hashCode(): Int

Returns the hash code value for this map.

open override fun hashCode(): Int

Returns the hash code value for this map.

isEmpty
Link copied to clipboard
expect open override fun isEmpty(): Boolean
abstract fun isEmpty(): Boolean

Returns true if the map is empty (contains no elements), false otherwise.

open override fun isEmpty(): Boolean

Returns true if the map is empty (contains no elements), false otherwise.

open override fun isEmpty(): Boolean

Returns true if the map is empty (contains no elements), false otherwise.

merge
Link copied to clipboard
open fun merge(p0: K, p1: V, p2: BiFunction<in V, in V, out V?>): V?
put
Link copied to clipboard
expect abstract override fun put(key: K, value: V): V?

Associates the specified value with the specified key in the map.

actual abstract override fun put(key: K, value: V): V?

Associates the specified value with the specified key in the map.

actual abstract override fun put(key: K, value: V): V?

Associates the specified value with the specified key in the map.

actual abstract override fun put(key: K, value: V): V?

Associates the specified value with the specified key in the map.

putAll
Link copied to clipboard
expect open override fun putAll(from: Map<out K, V>)
abstract fun putAll(from: Map<out K, V>)

Updates this map with key/value pairs from the specified map from.

actual open override fun putAll(from: Map<out K, V>)

Updates this map with key/value pairs from the specified map from.

actual open override fun putAll(from: Map<out K, V>)

Updates this map with key/value pairs from the specified map from.

putIfAbsent
Link copied to clipboard
open fun putIfAbsent(p0: K, p1: V): V?
remove
Link copied to clipboard
expect open override fun remove(key: K): V?
abstract fun remove(key: K): V?

Removes the specified key and its corresponding value from this map.

open fun remove(key: K, value: V): Boolean

Removes the entry for the specified key only if it is mapped to the specified value.

Since Kotlin

1.1
actual open override fun remove(key: K): V?

Removes the specified key and its corresponding value from this map.

open fun remove(key: K, value: V): Boolean

Removes the entry for the specified key only if it is mapped to the specified value.

Since Kotlin

1.1
actual open override fun remove(key: K): V?

Removes the specified key and its corresponding value from this map.

open fun remove(key: K, value: V): Boolean

Removes the entry for the specified key only if it is mapped to the specified value.

Since Kotlin

1.1
replace
Link copied to clipboard
open fun replace(p0: K, p1: V): V?
open fun replace(p0: K, p1: V, p2: V): Boolean
replaceAll
Link copied to clipboard
open fun replaceAll(p0: BiFunction<in K, in V, out V>)
toString
Link copied to clipboard
open override fun toString(): String
fun toString(entry: Map.Entry<K, V>): String
open override fun toString(): String
fun toString(entry: Map.Entry<K, V>): String

Properties

entries
Link copied to clipboard
abstract override val entries: MutableSet<MutableMap.MutableEntry<K, V>>

Returns a MutableSet of all key/value pairs in this map.

entries
Link copied to clipboard
abstract val entries: Set<Map.Entry<K, V>>

Returns a read-only Set of all key/value pairs in this map.

entries
Link copied to clipboard
abstract val entries: Set<Map.Entry<K, V>>

Returns a read-only Set of all key/value pairs in this map.

entries
Link copied to clipboard
expect abstract override val entries: MutableSet<MutableMap.MutableEntry<K, V>>
keys
Link copied to clipboard
abstract override val keys: MutableSet<K>

Returns a MutableSet of all keys in this map.

keys
Link copied to clipboard
expect open override val keys: MutableSet<K>
actual open override val keys: MutableSet<K>

Returns a read-only Set of all keys in this map.

actual open override val keys: MutableSet<K>

Returns a read-only Set of all keys in this map.

keySet
Link copied to clipboard
val keySet: MutableSet<K>
size
Link copied to clipboard
abstract val size: Int

Returns the number of key/value pairs in the map.

size
Link copied to clipboard
open override val size: Int

Returns the number of key/value pairs in the map.

size
Link copied to clipboard
open override val size: Int

Returns the number of key/value pairs in the map.

size
Link copied to clipboard
expect open override val size: Int
values
Link copied to clipboard
abstract override val values: MutableCollection<V>

Returns a MutableCollection of all values in this map. Note that this collection may contain duplicate values.

values
Link copied to clipboard
val values: MutableCollection<V>
values
Link copied to clipboard
expect open override val values: MutableCollection<V>
actual open override val values: MutableCollection<V>

Returns a read-only Collection of all values in this map.

actual open override val values: MutableCollection<V>

Returns a read-only Collection of all values in this map.

Inheritors

HashMap
Link copied to clipboard