# MutableScatterMap

Artifact: [androidx.collection:collection](https://developer.android.com/jetpack/androidx/releases/collection) [View Source](https://cs.android.com/search?q=file:androidx/collection/ScatterMap.+class:androidx.collection.MutableScatterMap) Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

*** ** * ** ***

Common/AllAndroid/JVMNative/C/iOSJavaScript
- Cmn

  ```
  class MutableScatterMap<K : Any?, V : Any?> : ScatterMap<K, V>
  ```

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.collection.ScatterMap](https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap)\<K, V\> ||
|   | ↳ | [androidx.collection.MutableScatterMap](https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap) |

*** ** * ** ***

`https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap` is a container with a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html`-like interface based on a flat hash table implementation (the key/value mappings are not stored by nodes but directly into arrays). The underlying implementation is designed to avoid all allocations on insertion, removal, retrieval, and iteration. Allocations may still happen on insertion when the underlying storage needs to grow to accommodate newly added entries to the table. In addition, this implementation minimizes memory usage by avoiding the use of separate objects to hold key/value pairs.

This implementation makes no guarantee as to the order of the keys and values stored, nor does it make guarantees that the order remains constant over time.

This implementation is not thread-safe: if multiple threads access this container concurrently, and one or more threads modify the structure of the map (insertion or removal for instance), the calling code must provide the appropriate synchronization. Multiple threads are safe to read from this map concurrently if no write is happening.

**Note** : when a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html` is absolutely necessary, you can use the method `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#asMap()` to create a thin wrapper around a `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap`. Please refer to `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#asMap()` for more details and caveats.

**Note** : when a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html` is absolutely necessary, you can use the method `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#asMutableMap()` to create a thin wrapper around a `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap`. Please refer to `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#asMutableMap()` for more details and caveats.

**MutableScatterMap and SimpleArrayMap** : like `https://developer.android.com/reference/kotlin/androidx/collection/SimpleArrayMap`, `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap` is designed to avoid the allocation of extra objects when inserting new entries in the map. However, the implementation of `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap` offers better performance characteristics compared to `https://developer.android.com/reference/kotlin/androidx/collection/SimpleArrayMap` and is thus generally preferable. If memory usage is a concern, `https://developer.android.com/reference/kotlin/androidx/collection/SimpleArrayMap` automatically shrinks its storage to avoid using more memory than necessary. You can also control memory usage with `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap` by manually calling `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#trim()`.

**Note**: For the JS target the implementation delegates to a regular map.

| See also |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html` |   |

## Summary

| ### Public constructors |
|---|---|
| `<K : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, V : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#MutableScatterMap(kotlin.Int)(initialCapacity: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Creates a new `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap` | Cmn android N JS |

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html<K, V>` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#asMutableMap()()` Wraps this `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap` with a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html` interface. | Cmn android N JS |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#clear()()` Removes all mappings from this map. | Cmn android N JS |
| `inline V` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#compute(kotlin.Any,kotlin.Function2)(key: K, computeBlock: (key, value?) -> V)` Retrieves a value for `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#compute(kotlin.Any,kotlin.Function2)` and computes a new value based on the existing value (or `null` if the key is not in the map). | Cmn android N JS |
| `inline V` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#getOrPut(kotlin.Any,kotlin.Function0)(key: K, defaultValue: () -> V)` Returns the value to which the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#getOrPut(kotlin.Any,kotlin.Function0)` is mapped, if the value is present in the map and not `null`. | Cmn android N JS |
| `inline operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#minusAssign(kotlin.Any)(key: K)` Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#minusAssign(kotlin.Any)` and its associated value from the map. | Cmn android N JS |
| `inline operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#minusAssign(kotlin.Array)(keys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<K>)` Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#minusAssign(kotlin.Array)` and their associated value from the map. | Cmn android N JS |
| `inline operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#minusAssign(kotlin.collections.Iterable)(keys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterable/index.html<K>)` Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#minusAssign(kotlin.collections.Iterable)` and their associated value from the map. | Cmn android N JS |
| `inline operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#minusAssign(androidx.collection.ObjectList)(keys: https://developer.android.com/reference/kotlin/androidx/collection/ObjectList<K>)` Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#minusAssign(androidx.collection.ObjectList)` and their associated value from the map. | Cmn android N JS |
| `inline operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#minusAssign(androidx.collection.ScatterSet)(keys: https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet<K>)` Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#minusAssign(androidx.collection.ScatterSet)` and their associated value from the map. | Cmn android N JS |
| `inline operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#minusAssign(kotlin.sequences.Sequence)(keys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.sequences/-sequence/index.html<K>)` Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#minusAssign(kotlin.sequences.Sequence)` and their associated value from the map. | Cmn android N JS |
| `inline operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#plusAssign(kotlin.collections.Map)(from: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<K, V>)` Puts all the key/value mappings in the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#plusAssign(kotlin.collections.Map)` map into this map. | Cmn android N JS |
| `inline operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#plusAssign(androidx.collection.ScatterMap)(from: https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap<K, V>)` Puts all the key/value mappings in the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#plusAssign(androidx.collection.ScatterMap)` map into this map. | Cmn android N JS |
| `inline operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#plusAssign(kotlin.Pair)(pair: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<K, V>)` Puts the key/value mapping from the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#plusAssign(kotlin.Pair)` in this map, using the first element as the key, and the second element as the value. | Cmn android N JS |
| `inline operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#plusAssign(kotlin.Array)(pairs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<K, V>>)` Puts all the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#plusAssign(kotlin.Array)` into this map, using the first component of the pair as the key, and the second component as the value. | Cmn android N JS |
| `inline operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#plusAssign(kotlin.collections.Iterable)(pairs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterable/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<K, V>>)` Puts all the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#plusAssign(kotlin.collections.Iterable)` into this map, using the first component of the pair as the key, and the second component as the value. | Cmn android N JS |
| `inline operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#plusAssign(kotlin.sequences.Sequence)(pairs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.sequences/-sequence/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<K, V>>)` Puts all the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#plusAssign(kotlin.sequences.Sequence)` into this map, using the first component of the pair as the key, and the second component as the value. | Cmn android N JS |
| `V?` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#put(kotlin.Any,kotlin.Any)(key: K, value: V)` Creates a new mapping from `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#put(kotlin.Any,kotlin.Any)` to `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#put(kotlin.Any,kotlin.Any)` in this map. | Cmn android N JS |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#putAll(kotlin.collections.Map)(from: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<K, V>)` Puts all the key/value mappings in the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#putAll(kotlin.collections.Map)` map into this map. | Cmn android N JS |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#putAll(androidx.collection.ScatterMap)(from: https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap<K, V>)` Puts all the key/value mappings in the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#putAll(androidx.collection.ScatterMap)` map into this map. | Cmn android N JS |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#putAll(kotlin.Array)(pairs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<K, V>>)` Puts all the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#putAll(kotlin.Array)` into this map, using the first component of the pair as the key, and the second component as the value. | Cmn android N JS |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#putAll(kotlin.collections.Iterable)(pairs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterable/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<K, V>>)` Puts all the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#putAll(kotlin.collections.Iterable)` into this map, using the first component of the pair as the key, and the second component as the value. | Cmn android N JS |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#putAll(kotlin.sequences.Sequence)(pairs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.sequences/-sequence/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<K, V>>)` Puts all the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#putAll(kotlin.sequences.Sequence)` into this map, using the first component of the pair as the key, and the second component as the value. | Cmn android N JS |
| `V?` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#remove(kotlin.Any)(key: K)` Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#remove(kotlin.Any)` and its associated value from the map. | Cmn android N JS |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#remove(kotlin.Any,kotlin.Any)(key: K, value: V)` Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#remove(kotlin.Any,kotlin.Any)` and its associated value from the map if the associated value equals `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#remove(kotlin.Any,kotlin.Any)`. | Cmn android N JS |
| `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#removeIf(kotlin.Function2)(predicate: (K, V) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Removes any mapping for which the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#removeIf(kotlin.Function2)` returns true. | Cmn android N JS |
| `operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#set(kotlin.Any,kotlin.Any)(key: K, value: V)` Creates a new mapping from `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#set(kotlin.Any,kotlin.Any)` to `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#set(kotlin.Any,kotlin.Any)` in this map. | Cmn android N JS |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#trim()()` Trims this `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap`'s storage so it is sized appropriately to hold the current mappings. | Cmn android N JS |

### Inherited functions

From [androidx.collection.ScatterMap](https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap) `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#all(kotlin.Function2)(predicate: (K, V) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

Returns true if all entries match the given `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#all(kotlin.Function2)`.
Cmn android N JS `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#any()()`

Returns `true` if this map has at least one entry.
Cmn android N JS `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#any(kotlin.Function2)(predicate: (K, V) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

Returns true if at least one entry matches the given `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#any(kotlin.Function2)`.
Cmn android N JS `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<K, V>` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#asMap()()`

Wraps this `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap` with a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html` interface.
Cmn android N JS `operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#contains(kotlin.Any)(key: K)`

Returns true if the specified `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#contains(kotlin.Any)` is present in this hash map, false otherwise.
Cmn android N JS `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#containsKey(kotlin.Any)(key: K)`

Returns true if the specified `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#containsKey(kotlin.Any)` is present in this hash map, false otherwise.
Cmn android N JS `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#containsValue(kotlin.Any)(value: V)`

Returns true if the specified `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#containsValue(kotlin.Any)` is present in this hash map, false otherwise.
Cmn android N JS `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#count()()`

Returns the number of entries in this map.
Cmn android N JS `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#count(kotlin.Function2)(predicate: (K, V) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

Returns the number of entries matching the given `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#count(kotlin.Function2)`.
Cmn android N JS `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)`

Compares the specified object `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#equals(kotlin.Any)` with this hash map for equality.
Cmn android N JS `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#forEach(kotlin.Function2)(block: (key, value) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)`

Iterates over every key/value pair stored in this map by invoking the specified `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#forEach(kotlin.Function2)` lambda.
Cmn android N JS `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#forEachKey(kotlin.Function1)(block: (key) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)`

Iterates over every key stored in this map by invoking the specified `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#forEachKey(kotlin.Function1)` lambda.
Cmn android N JS `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#forEachValue(kotlin.Function1)(block: (value) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)`

Iterates over every value stored in this map by invoking the specified `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#forEachValue(kotlin.Function1)` lambda.
Cmn android N JS `operator V?` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#get(kotlin.Any)(key: K)`

Returns the value corresponding to the given `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#get(kotlin.Any)`, or `null` if such a key is not present in the map.
Cmn android N JS `V` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#getOrDefault(kotlin.Any,kotlin.Any)(key: K, defaultValue: V)`

Returns the value to which the specified `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#getOrDefault(kotlin.Any,kotlin.Any)` is mapped, or `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#getOrDefault(kotlin.Any,kotlin.Any)` if this map contains no mapping for the key.
Cmn android N JS `inline V` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#getOrElse(kotlin.Any,kotlin.Function0)(key: K, defaultValue: () -> V)`

Returns the value for the given `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#getOrElse(kotlin.Any,kotlin.Function0)` if the value is present and not null.
Cmn android N JS `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#hashCode()()`

Returns the hash code value for this map.
Cmn android N JS `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#isEmpty()()`

Indicates whether this map is empty.
Cmn android N JS `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#isNotEmpty()()`

Returns `true` if this map is not empty.
Cmn android N JS `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2)(
separator: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html,
prefix: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html,
postfix: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html,
limit: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
truncated: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html,
transform: ((key, value) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)?
)`

Creates a String from the elements separated by `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2)` and using `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2)` before and `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2)` after, if supplied.
Cmn android N JS `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#none()()`

Returns `true` if this map has no entries.
Cmn android N JS `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#toString()()`

Returns a string representation of this map.
Cmn android N JS

### Inherited properties

From [androidx.collection.ScatterMap](https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#capacity()`

Returns the number of key-value pairs that can be stored in this map without requiring internal storage reallocation.
Cmn android N JS `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap#size()`

Returns the number of key-value pairs in this map.
Cmn android N JS

## Public constructors

### MutableScatterMap

Cmn android N JS

```
<K : Any?, V : Any?> MutableScatterMap(
    initialCapacity: Int = DefaultScatterCapacity
)
```

Creates a new `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap`

| Parameters |
|---|---|
| `initialCapacity: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = DefaultScatterCapacity` | The initial desired capacity for this container. The container will honor this value by guaranteeing its internal structures can hold that many entries without requiring any allocations. The initial capacity can be set to 0. |

## Public functions

### asMutableMap

Cmn android N JS Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
fun asMutableMap(): MutableMap<K, V>
```

Wraps this `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap` with a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html` interface. The `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html` is backed by the `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap`, so changes to the `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap` are reflected in the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html` and vice-versa. If the `https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap` is modified while an iteration over the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html` is in progress (and vice- versa), the results of the iteration are undefined.

**Note** : while this method is useful to use this `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap` with APIs accepting `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html` interfaces, it is less efficient to do so than to use `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap`'s APIs directly. While the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html` implementation returned by this method tries to be as efficient as possible, the semantics of `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html` may require the allocation of temporary objects for access and iteration.

### clear

Cmn android N JS Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
fun clear(): Unit
```

Removes all mappings from this map.

### compute

Cmn android N JS Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
inline fun compute(key: K, computeBlock: (key, value?) -> V): V
```

Retrieves a value for `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#compute(kotlin.Any,kotlin.Function2)` and computes a new value based on the existing value (or `null` if the key is not in the map). The computed value is then stored in the map for the given `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#compute(kotlin.Any,kotlin.Function2)`.

| Returns |
|---|---|
| `V` | value computed by `computeBlock`. |

### getOrPut

Cmn android N JS Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
inline fun getOrPut(key: K, defaultValue: () -> V): V
```

Returns the value to which the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#getOrPut(kotlin.Any,kotlin.Function0)` is mapped, if the value is present in the map and not `null`. Otherwise, calls `defaultValue()` and puts the result in the map associated with `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#getOrPut(kotlin.Any,kotlin.Function0)`.

### minusAssign

Cmn android N JS Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
inline operator fun minusAssign(key: K): Unit
```

Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#minusAssign(kotlin.Any)` and its associated value from the map.

### minusAssign

Cmn android N JS Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
inline operator fun minusAssign(keys: Array<K>): Unit
```

Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#minusAssign(kotlin.Array)` and their associated value from the map.

### minusAssign

Cmn android N JS

```
inline operator fun minusAssign(keys: Iterable<K>): Unit
```

Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#minusAssign(kotlin.collections.Iterable)` and their associated value from the map.

### minusAssign

Cmn android N JS Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
inline operator fun minusAssign(keys: ObjectList<K>): Unit
```

Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#minusAssign(androidx.collection.ObjectList)` and their associated value from the map.

### minusAssign

Cmn android N JS Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
inline operator fun minusAssign(keys: ScatterSet<K>): Unit
```

Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#minusAssign(androidx.collection.ScatterSet)` and their associated value from the map.

### minusAssign

Cmn android N JS

```
inline operator fun minusAssign(keys: Sequence<K>): Unit
```

Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#minusAssign(kotlin.sequences.Sequence)` and their associated value from the map.

### plusAssign

Cmn android N JS

```
inline operator fun plusAssign(from: Map<K, V>): Unit
```

Puts all the key/value mappings in the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#plusAssign(kotlin.collections.Map)` map into this map.

### plusAssign

Cmn android N JS Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
inline operator fun plusAssign(from: ScatterMap<K, V>): Unit
```

Puts all the key/value mappings in the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#plusAssign(androidx.collection.ScatterMap)` map into this map.

### plusAssign

Cmn android N JS

```
inline operator fun plusAssign(pair: Pair<K, V>): Unit
```

Puts the key/value mapping from the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#plusAssign(kotlin.Pair)` in this map, using the first element as the key, and the second element as the value.

### plusAssign

Cmn android N JS

```
inline operator fun plusAssign(pairs: Array<Pair<K, V>>): Unit
```

Puts all the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#plusAssign(kotlin.Array)` into this map, using the first component of the pair as the key, and the second component as the value.

### plusAssign

Cmn android N JS

```
inline operator fun plusAssign(pairs: Iterable<Pair<K, V>>): Unit
```

Puts all the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#plusAssign(kotlin.collections.Iterable)` into this map, using the first component of the pair as the key, and the second component as the value.

### plusAssign

Cmn android N JS

```
inline operator fun plusAssign(pairs: Sequence<Pair<K, V>>): Unit
```

Puts all the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#plusAssign(kotlin.sequences.Sequence)` into this map, using the first component of the pair as the key, and the second component as the value.

### put

Cmn android N JS Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
fun put(key: K, value: V): V?
```

Creates a new mapping from `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#put(kotlin.Any,kotlin.Any)` to `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#put(kotlin.Any,kotlin.Any)` in this map. If `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#put(kotlin.Any,kotlin.Any)` is already present in the map, the association is modified and the previously associated value is replaced with `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#put(kotlin.Any,kotlin.Any)`. If `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#put(kotlin.Any,kotlin.Any)` is not present, a new entry is added to the map, which may require to grow the underlying storage and cause allocations. Return the previous value associated with the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#put(kotlin.Any,kotlin.Any)`, or `null` if the key was not present in the map.

### putAll

Cmn android N JS

```
fun putAll(from: Map<K, V>): Unit
```

Puts all the key/value mappings in the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#putAll(kotlin.collections.Map)` map into this map.

### putAll

Cmn android N JS Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
fun putAll(from: ScatterMap<K, V>): Unit
```

Puts all the key/value mappings in the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#putAll(androidx.collection.ScatterMap)` map into this map.

### putAll

Cmn android N JS

```
fun putAll(pairs: Array<Pair<K, V>>): Unit
```

Puts all the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#putAll(kotlin.Array)` into this map, using the first component of the pair as the key, and the second component as the value.

### putAll

Cmn android N JS

```
fun putAll(pairs: Iterable<Pair<K, V>>): Unit
```

Puts all the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#putAll(kotlin.collections.Iterable)` into this map, using the first component of the pair as the key, and the second component as the value.

### putAll

Cmn android N JS

```
fun putAll(pairs: Sequence<Pair<K, V>>): Unit
```

Puts all the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#putAll(kotlin.sequences.Sequence)` into this map, using the first component of the pair as the key, and the second component as the value.

### remove

Cmn android N JS Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
fun remove(key: K): V?
```

Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#remove(kotlin.Any)` and its associated value from the map. If the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#remove(kotlin.Any)` was present in the map, this function returns the value that was present before removal.

### remove

Cmn android N JS Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

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

Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#remove(kotlin.Any,kotlin.Any)` and its associated value from the map if the associated value equals `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#remove(kotlin.Any,kotlin.Any)`. Returns whether the removal happened.

### removeIf

Cmn android N JS Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
inline fun removeIf(predicate: (K, V) -> Boolean): Unit
```

Removes any mapping for which the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#removeIf(kotlin.Function2)` returns true.

### set

Cmn android N JS Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
operator fun set(key: K, value: V): Unit
```

Creates a new mapping from `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#set(kotlin.Any,kotlin.Any)` to `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#set(kotlin.Any,kotlin.Any)` in this map. If `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#set(kotlin.Any,kotlin.Any)` is already present in the map, the association is modified and the previously associated value is replaced with `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#set(kotlin.Any,kotlin.Any)`. If `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap#set(kotlin.Any,kotlin.Any)` is not present, a new entry is added to the map, which may require to grow the underlying storage and cause allocations.

### trim

Cmn android N JS Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
fun trim(): Int
```

Trims this `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterMap`'s storage so it is sized appropriately to hold the current mappings.

Returns the number of empty entries removed from this map's storage. Returns be 0 if no trimming is necessary or possible.