# ScatterMap

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.ScatterMap) Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

*** ** * ** ***


```
public sealed class ScatterMap<K extends Object, V extends Object>
```

<br />

Known direct subclasses [MutableScatterMap](https://developer.android.com/reference/androidx/collection/MutableScatterMap)

|---|---|
| `https://developer.android.com/reference/androidx/collection/MutableScatterMap` | `https://developer.android.com/reference/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). |

*** ** * ** ***

`https://developer.android.com/reference/androidx/collection/ScatterMap` 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.

This implementation is read-only and only allows data to be queried. A mutable implementation is provided by `https://developer.android.com/reference/androidx/collection/MutableScatterMap`.

**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/androidx/collection/ScatterMap#asMap()` to create a thin wrapper around a `https://developer.android.com/reference/androidx/collection/ScatterMap`. Please refer to `https://developer.android.com/reference/androidx/collection/ScatterMap#asMap()` for more details and caveats.

**ScatterMap and SimpleArrayMap** : like `https://developer.android.com/reference/androidx/collection/SimpleArrayMap`, `https://developer.android.com/reference/androidx/collection/ScatterMap`/`https://developer.android.com/reference/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/androidx/collection/ScatterMap`/`https://developer.android.com/reference/androidx/collection/MutableScatterMap` offers better performance characteristics compared to `https://developer.android.com/reference/androidx/collection/SimpleArrayMap` and is thus generally preferable. If memory usage is a concern, `https://developer.android.com/reference/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/androidx/collection/MutableScatterMap` by manually calling `https://developer.android.com/reference/androidx/collection/MutableScatterMap#trim()`.

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

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/collection/MutableScatterMap` |   |

## Summary

| ### Protected constructors |
|---|
| `<K extends https://developer.android.com/reference/java/lang/Object.html, V extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/collection/ScatterMap#ScatterMap()()` |

| ### Public methods |
|---|---|
| `final boolean` | `https://developer.android.com/reference/androidx/collection/ScatterMap#all(kotlin.Function2)(@https://developer.android.com/reference/androidx/annotation/NonNull Function2<@https://developer.android.com/reference/androidx/annotation/NonNull K, @https://developer.android.com/reference/androidx/annotation/NonNull V, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html> predicate)` Returns true if all entries match the given `https://developer.android.com/reference/androidx/collection/ScatterMap#all(kotlin.Function2)`. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/ScatterMap#any()()` Returns `true` if this map has at least one entry. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/ScatterMap#any(kotlin.Function2)(@https://developer.android.com/reference/androidx/annotation/NonNull Function2<@https://developer.android.com/reference/androidx/annotation/NonNull K, @https://developer.android.com/reference/androidx/annotation/NonNull V, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html> predicate)` Returns true if at least one entry matches the given `https://developer.android.com/reference/androidx/collection/ScatterMap#any(kotlin.Function2)`. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull K, @https://developer.android.com/reference/androidx/annotation/NonNull V>` | `https://developer.android.com/reference/androidx/collection/ScatterMap#asMap()()` Wraps this `https://developer.android.com/reference/androidx/collection/ScatterMap` with a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html` interface. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/ScatterMap#contains(kotlin.Any)(@https://developer.android.com/reference/androidx/annotation/NonNull K key)` Returns true if the specified `https://developer.android.com/reference/androidx/collection/ScatterMap#contains(kotlin.Any)` is present in this hash map, false otherwise. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/ScatterMap#containsKey(kotlin.Any)(@https://developer.android.com/reference/androidx/annotation/NonNull K key)` Returns true if the specified `https://developer.android.com/reference/androidx/collection/ScatterMap#containsKey(kotlin.Any)` is present in this hash map, false otherwise. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/ScatterMap#containsValue(kotlin.Any)(@https://developer.android.com/reference/androidx/annotation/NonNull V value)` Returns true if the specified `https://developer.android.com/reference/androidx/collection/ScatterMap#containsValue(kotlin.Any)` is present in this hash map, false otherwise. |
| `final int` | `https://developer.android.com/reference/androidx/collection/ScatterMap#count()()` Returns the number of entries in this map. |
| `final int` | `https://developer.android.com/reference/androidx/collection/ScatterMap#count(kotlin.Function2)(@https://developer.android.com/reference/androidx/annotation/NonNull Function2<@https://developer.android.com/reference/androidx/annotation/NonNull K, @https://developer.android.com/reference/androidx/annotation/NonNull V, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html> predicate)` Returns the number of entries matching the given `https://developer.android.com/reference/androidx/collection/ScatterMap#count(kotlin.Function2)`. |
| `boolean` | `https://developer.android.com/reference/androidx/collection/ScatterMap#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` Compares the specified object `https://developer.android.com/reference/androidx/collection/ScatterMap#equals(kotlin.Any)` with this hash map for equality. |
| `final void` | `https://developer.android.com/reference/androidx/collection/ScatterMap#forEach(kotlin.Function2)(@https://developer.android.com/reference/androidx/annotation/NonNull Function2<@https://developer.android.com/reference/androidx/annotation/NonNull key, @https://developer.android.com/reference/androidx/annotation/NonNull value, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> block)` Iterates over every key/value pair stored in this map by invoking the specified `https://developer.android.com/reference/androidx/collection/ScatterMap#forEach(kotlin.Function2)` lambda. |
| `final void` | `https://developer.android.com/reference/androidx/collection/ScatterMap#forEachKey(kotlin.Function1)(@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull key, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> block)` Iterates over every key stored in this map by invoking the specified `https://developer.android.com/reference/androidx/collection/ScatterMap#forEachKey(kotlin.Function1)` lambda. |
| `final void` | `https://developer.android.com/reference/androidx/collection/ScatterMap#forEachValue(kotlin.Function1)(@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull value, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> block)` Iterates over every value stored in this map by invoking the specified `https://developer.android.com/reference/androidx/collection/ScatterMap#forEachValue(kotlin.Function1)` lambda. |
| `final V` | `https://developer.android.com/reference/androidx/collection/ScatterMap#get(kotlin.Any)(@https://developer.android.com/reference/androidx/annotation/NonNull K key)` Returns the value corresponding to the given `https://developer.android.com/reference/androidx/collection/ScatterMap#get(kotlin.Any)`, or `null` if such a key is not present in the map. |
| `final int` | `https://developer.android.com/reference/androidx/collection/ScatterMap#getCapacity()()` Returns the number of key-value pairs that can be stored in this map without requiring internal storage reallocation. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull V` | `https://developer.android.com/reference/androidx/collection/ScatterMap#getOrDefault(kotlin.Any,kotlin.Any)(@https://developer.android.com/reference/androidx/annotation/NonNull K key, @https://developer.android.com/reference/androidx/annotation/NonNull V defaultValue)` Returns the value to which the specified `https://developer.android.com/reference/androidx/collection/ScatterMap#getOrDefault(kotlin.Any,kotlin.Any)` is mapped, or `https://developer.android.com/reference/androidx/collection/ScatterMap#getOrDefault(kotlin.Any,kotlin.Any)` if this map contains no mapping for the key. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull V` | `https://developer.android.com/reference/androidx/collection/ScatterMap#getOrElse(kotlin.Any,kotlin.Function0)(@https://developer.android.com/reference/androidx/annotation/NonNull K key, @https://developer.android.com/reference/androidx/annotation/NonNull Function0<@https://developer.android.com/reference/androidx/annotation/NonNull V> defaultValue)` Returns the value for the given `https://developer.android.com/reference/androidx/collection/ScatterMap#getOrElse(kotlin.Any,kotlin.Function0)` if the value is present and not null. |
| `final int` | `https://developer.android.com/reference/androidx/collection/ScatterMap#getSize()()` Returns the number of key-value pairs in this map. |
| `int` | `https://developer.android.com/reference/androidx/collection/ScatterMap#hashCode()()` Returns the hash code value for this map. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/ScatterMap#isEmpty()()` Indicates whether this map is empty. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/ScatterMap#isNotEmpty()()` Returns `true` if this map is not empty. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/collection/ScatterMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html separator, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html prefix, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html postfix, int limit, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html truncated, Function2<@https://developer.android.com/reference/androidx/annotation/NonNull key, @https://developer.android.com/reference/androidx/annotation/NonNull value, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html> transform )` Creates a String from the elements separated by `https://developer.android.com/reference/androidx/collection/ScatterMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2)` and using `https://developer.android.com/reference/androidx/collection/ScatterMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2)` before and `https://developer.android.com/reference/androidx/collection/ScatterMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2)` after, if supplied. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/ScatterMap#none()()` Returns `true` if this map has no entries. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/collection/ScatterMap#toString()()` Returns a string representation of this map. |

| ### Extension functions |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/MutableScatterMap<@https://developer.android.com/reference/androidx/annotation/NonNull K, @https://developer.android.com/reference/androidx/annotation/NonNull V>` | `<K extends https://developer.android.com/reference/java/lang/Object.html, V extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/collection/ScatterMapKt.https://developer.android.com/reference/androidx/collection/ScatterMap#(androidx.collection.ScatterMap).toMutableScatterMap()( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/ScatterMap<@https://developer.android.com/reference/androidx/annotation/NonNull K, @https://developer.android.com/reference/androidx/annotation/NonNull V> receiver )` Returns a new `https://developer.android.com/reference/androidx/collection/MutableScatterMap` with the specified mappings. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/ScatterMap<@https://developer.android.com/reference/androidx/annotation/NonNull K, @https://developer.android.com/reference/androidx/annotation/NonNull V>` | `<K extends https://developer.android.com/reference/java/lang/Object.html, V extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/collection/ScatterMapKt.https://developer.android.com/reference/androidx/collection/ScatterMap#(androidx.collection.ScatterMap).toScatterMap()( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/ScatterMap<@https://developer.android.com/reference/androidx/annotation/NonNull K, @https://developer.android.com/reference/androidx/annotation/NonNull V> receiver )` Returns a new read-only `https://developer.android.com/reference/androidx/collection/ScatterMap` with the specified mappings. |

## Protected constructors

### ScatterMap

```
protected <K extends Object, V extends Object> ScatterMap()
```

## Public methods

### all

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

```
public final boolean all(@NonNull Function2<@NonNull K, @NonNull V, @NonNull Boolean> predicate)
```

Returns true if all entries match the given `https://developer.android.com/reference/androidx/collection/ScatterMap#all(kotlin.Function2)`.

### any

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

```
public final boolean any()
```

Returns `true` if this map has at least one entry.

### any

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

```
public final boolean any(@NonNull Function2<@NonNull K, @NonNull V, @NonNull Boolean> predicate)
```

Returns true if at least one entry matches the given `https://developer.android.com/reference/androidx/collection/ScatterMap#any(kotlin.Function2)`.

### asMap

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

```
public final @NonNull Map<@NonNull K, @NonNull V> asMap()
```

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

**Note** : while this method is useful to use this `https://developer.android.com/reference/androidx/collection/ScatterMap` with APIs accepting `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html` interfaces, it is less efficient to do so than to use `https://developer.android.com/reference/androidx/collection/ScatterMap`'s APIs directly. While the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-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/-map/index.html` may require the allocation of temporary objects for access and iteration.

### contains

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

```
public final boolean contains(@NonNull K key)
```

Returns true if the specified `https://developer.android.com/reference/androidx/collection/ScatterMap#contains(kotlin.Any)` is present in this hash map, false otherwise.

### containsKey

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

```
public final boolean containsKey(@NonNull K key)
```

Returns true if the specified `https://developer.android.com/reference/androidx/collection/ScatterMap#containsKey(kotlin.Any)` is present in this hash map, false otherwise.

### containsValue

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

```
public final boolean containsValue(@NonNull V value)
```

Returns true if the specified `https://developer.android.com/reference/androidx/collection/ScatterMap#containsValue(kotlin.Any)` is present in this hash map, false otherwise.

### count

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

```
public final int count()
```

Returns the number of entries in this map.

### count

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

```
public final int count(@NonNull Function2<@NonNull K, @NonNull V, @NonNull Boolean> predicate)
```

Returns the number of entries matching the given `https://developer.android.com/reference/androidx/collection/ScatterMap#count(kotlin.Function2)`.

### equals

```
public boolean equals(Object other)
```

Compares the specified object `https://developer.android.com/reference/androidx/collection/ScatterMap#equals(kotlin.Any)` with this hash map for equality. The two objects are considered equal if `https://developer.android.com/reference/androidx/collection/ScatterMap#equals(kotlin.Any)`:

- Is a `https://developer.android.com/reference/androidx/collection/ScatterMap`

- Has the same `https://developer.android.com/reference/androidx/collection/ScatterMap#size()` as this map

- Contains key/value pairs equal to this map's pair

### forEach

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

```
public final void forEach(@NonNull Function2<@NonNull key, @NonNull value, Unit> block)
```

Iterates over every key/value pair stored in this map by invoking the specified `https://developer.android.com/reference/androidx/collection/ScatterMap#forEach(kotlin.Function2)` lambda.

### forEachKey

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

```
public final void forEachKey(@NonNull Function1<@NonNull key, Unit> block)
```

Iterates over every key stored in this map by invoking the specified `https://developer.android.com/reference/androidx/collection/ScatterMap#forEachKey(kotlin.Function1)` lambda.

### forEachValue

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

```
public final void forEachValue(@NonNull Function1<@NonNull value, Unit> block)
```

Iterates over every value stored in this map by invoking the specified `https://developer.android.com/reference/androidx/collection/ScatterMap#forEachValue(kotlin.Function1)` lambda.

### get

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

```
public final V get(@NonNull K key)
```

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

### getCapacity

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

```
public final int getCapacity()
```

Returns the number of key-value pairs that can be stored in this map without requiring internal storage reallocation.

### getOrDefault

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

```
public final @NonNull V getOrDefault(@NonNull K key, @NonNull V defaultValue)
```

Returns the value to which the specified `https://developer.android.com/reference/androidx/collection/ScatterMap#getOrDefault(kotlin.Any,kotlin.Any)` is mapped, or `https://developer.android.com/reference/androidx/collection/ScatterMap#getOrDefault(kotlin.Any,kotlin.Any)` if this map contains no mapping for the key.

### getOrElse

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

```
public final @NonNull V getOrElse(@NonNull K key, @NonNull Function0<@NonNull V> defaultValue)
```

Returns the value for the given `https://developer.android.com/reference/androidx/collection/ScatterMap#getOrElse(kotlin.Any,kotlin.Function0)` if the value is present and not null. Otherwise, returns the result of the `https://developer.android.com/reference/androidx/collection/ScatterMap#getOrElse(kotlin.Any,kotlin.Function0)` function.

### getSize

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

```
public final int getSize()
```

Returns the number of key-value pairs in this map.

### hashCode

```
public int hashCode()
```

Returns the hash code value for this map. The hash code the sum of the hash codes of each key/value pair.

### isEmpty

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

```
public final boolean isEmpty()
```

Indicates whether this map is empty.

### isNotEmpty

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

```
public final boolean isNotEmpty()
```

Returns `true` if this map is not empty.

### joinToString

```
public final @NonNull String joinToString(
    @NonNull CharSequence separator,
    @NonNull CharSequence prefix,
    @NonNull CharSequence postfix,
    int limit,
    @NonNull CharSequence truncated,
    Function2<@NonNull key, @NonNull value, @NonNull CharSequence> transform
)
```

Creates a String from the elements separated by `https://developer.android.com/reference/androidx/collection/ScatterMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2)` and using `https://developer.android.com/reference/androidx/collection/ScatterMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2)` before and `https://developer.android.com/reference/androidx/collection/ScatterMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2)` after, if supplied.

When a non-negative value of `https://developer.android.com/reference/androidx/collection/ScatterMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2)` is provided, a maximum of `https://developer.android.com/reference/androidx/collection/ScatterMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2)` items are used to generate the string. If the collection holds more than `https://developer.android.com/reference/androidx/collection/ScatterMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2)` items, the string is terminated with `https://developer.android.com/reference/androidx/collection/ScatterMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2)`.

`https://developer.android.com/reference/androidx/collection/ScatterMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2)` may be supplied to convert each element to a custom String.

### none

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

```
public final boolean none()
```

Returns `true` if this map has no entries.

### toString

```
public @NonNull String toString()
```

Returns a string representation of this map. The map is denoted in the string by the `{}`. Each key/value pair present in the map is represented inside '{}`by a substring of the form `key=value`, and pairs are separated by `, \`.

## Extension functions

### ScatterMapKt.toMutableScatterMap

Artifact: [androidx.collection:collection](https://developer.android.com/jetpack/androidx/releases/collection) [View Source](https://cs.android.com/search?q=file:androidx/collection/ScatterMap.kt+function:toMutableScatterMap)

```
public final @NonNull MutableScatterMap<@NonNull K, @NonNull V> <K extends Object, V extends Object> ScatterMapKt.toMutableScatterMap(
    @NonNull ScatterMap<@NonNull K, @NonNull V> receiver
)
```

Returns a new `https://developer.android.com/reference/androidx/collection/MutableScatterMap` with the specified mappings.

The `https://developer.android.com/reference/androidx/collection/MutableScatterMap` is created with an initial capacity sufficient to hold the mappings in the specified `https://developer.android.com/reference/androidx/collection/ScatterMap`.

### ScatterMapKt.toScatterMap

Artifact: [androidx.collection:collection](https://developer.android.com/jetpack/androidx/releases/collection) [View Source](https://cs.android.com/search?q=file:androidx/collection/ScatterMap.kt+function:toScatterMap)

```
public final @NonNull ScatterMap<@NonNull K, @NonNull V> <K extends Object, V extends Object> ScatterMapKt.toScatterMap(
    @NonNull ScatterMap<@NonNull K, @NonNull V> receiver
)
```

Returns a new read-only `https://developer.android.com/reference/androidx/collection/ScatterMap` with the specified mappings.