interface MutableMap
source · line 46public
public interface MutableMap<K, V> : Map<K, V>, IndexSet<K, V>
- Supertype
Map<K, V> - Supertype
IndexSet<K, V> - Inherited
operator fun contains(value: K): Boolean· Map<K, V> - Inherited
fun containsKey(key: K): Boolean· Map<K, V> - Inherited
operator fun get(key: K): Option<V>· Map<K, V> - Inherited
val entries: Collection<Map.Entry<K, V>>· Map<K, V> - Inherited
operator fun iterator(): Iterator<Map.Entry<K, V>>· Iterable<Map.Entry<K, V>> - Inherited
val keys: Set<K>· Map<K, V> - Inherited
val size: Long· Map<K, V> - Inherited
val values: Collection<V>· Map<K, V>
A map supporting insertion, replacement, removal, and clearing.
Extensions
public fun <K, V> MutableMap<K, V>.getOrPut(key: K, defaultValue: () -> V): V· scoop:scoop.std:0.1.0public fun <K, V> MutableMap<K, V>.putAll(entries: Map<K, V>): Unit· scoop:scoop.std:0.1.0public fun <K, V> MutableMap<K, V>.putAll(entries: Iterable<(K, V)>): Unit· scoop:scoop.std:0.1.0
type parameter K
source · line 46public
K
type parameter V
source · line 46public
V
function clear
source · line 62public
public fun clear(): Unit
Removes every association.
function set
source · line 54public
public override operator fun set(key: K, value: V): Unit
- Overrides
set
Associates the value with the key, discarding any previous value.
parameter value
source · line 54public
value: V
parameter key
source · line 54public
key: K
function put
source · line 50public
public fun put(key: K, value: V): V?
Associates the value with the key and returns the previous value, or None for a new key.
parameter key
source · line 50public
key: K
parameter value
source · line 50public
value: V
function remove
source · line 58public
public fun remove(key: K): V?
Removes the key and returns its former value, or None if absent.
parameter key
source · line 58public
key: K