# MutableScatterSet

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

*** ** * ** ***

Common/AllAndroid/JVMNative/C/iOSJavaScript
- Cmn

  ```
  class MutableScatterSet<E : Any?> : ScatterSet<E>
  ```

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.collection.ScatterSet](https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet)\<E\> ||
|   | ↳ | [androidx.collection.MutableScatterSet](https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet) |

*** ** * ** ***

`https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet` is a container with a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html`-like interface based on a flat hash table implementation. 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 elements to the set.

This implementation makes no guarantee as to the order of the elements 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 set (insertion or removal for instance), the calling code must provide the appropriate synchronization. Concurrent reads are however safe.

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

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

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

## Summary

| ### Public constructors |
|---|---|
| `<E : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#MutableScatterSet(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/MutableScatterSet` | Cmn android N JS |

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#add(kotlin.Any)(element: E)` Adds the specified element to the set. | Cmn android N JS |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#addAll(kotlin.Array)(elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<E>)` Adds all the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#addAll(kotlin.Array)` into this set. | Cmn android N JS |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#addAll(kotlin.collections.Iterable)(elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterable/index.html<E>)` Adds all the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#addAll(kotlin.collections.Iterable)` into this set. | Cmn android N JS |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#addAll(androidx.collection.ObjectList)(elements: https://developer.android.com/reference/kotlin/androidx/collection/ObjectList<E>)` Adds all the elements in the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#addAll(androidx.collection.ObjectList)` set into this set. | Cmn android N JS |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#addAll(androidx.collection.OrderedScatterSet)(elements: https://developer.android.com/reference/kotlin/androidx/collection/OrderedScatterSet<E>)` Adds all the elements in the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#addAll(androidx.collection.OrderedScatterSet)` set into this set. | Cmn android N JS |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#addAll(androidx.collection.ScatterSet)(elements: https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet<E>)` Adds all the elements in the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#addAll(androidx.collection.ScatterSet)` set into this set. | Cmn android N JS |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#addAll(kotlin.sequences.Sequence)(elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.sequences/-sequence/index.html<E>)` Adds all the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#addAll(kotlin.sequences.Sequence)` into this set. | Cmn android N JS |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html<E>` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#asMutableSet()()` Wraps this `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet` with a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/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/MutableScatterSet#clear()()` Removes all elements from this set. | Cmn android N JS |
| `operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#minusAssign(kotlin.Any)(element: E)` Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#minusAssign(kotlin.Any)` from the set if it is present. | Cmn android N JS |
| `operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#minusAssign(kotlin.Array)(elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<E>)` Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#minusAssign(kotlin.Array)` from the set, if present. | Cmn android N JS |
| `operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#minusAssign(kotlin.collections.Iterable)(elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterable/index.html<E>)` Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#minusAssign(kotlin.collections.Iterable)` from the set, if present. | Cmn android N JS |
| `operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#minusAssign(androidx.collection.ObjectList)(elements: https://developer.android.com/reference/kotlin/androidx/collection/ObjectList<E>)` Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#minusAssign(androidx.collection.ObjectList)` from the set, if present. | Cmn android N JS |
| `operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#minusAssign(androidx.collection.OrderedScatterSet)(elements: https://developer.android.com/reference/kotlin/androidx/collection/OrderedScatterSet<E>)` Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#minusAssign(androidx.collection.OrderedScatterSet)` from the set, if present. | Cmn android N JS |
| `operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#minusAssign(androidx.collection.ScatterSet)(elements: https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet<E>)` Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#minusAssign(androidx.collection.ScatterSet)` from the set, if present. | Cmn android N JS |
| `operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#minusAssign(kotlin.sequences.Sequence)(elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.sequences/-sequence/index.html<E>)` Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#minusAssign(kotlin.sequences.Sequence)` from the set, if present. | Cmn android N JS |
| `operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#plusAssign(kotlin.Any)(element: E)` Adds the specified element to the set. | Cmn android N JS |
| `operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#plusAssign(kotlin.Array)(elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<E>)` Adds all the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#plusAssign(kotlin.Array)` into this set. | Cmn android N JS |
| `operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#plusAssign(kotlin.collections.Iterable)(elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterable/index.html<E>)` Adds all the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#plusAssign(kotlin.collections.Iterable)` into this set. | Cmn android N JS |
| `operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#plusAssign(androidx.collection.ObjectList)(elements: https://developer.android.com/reference/kotlin/androidx/collection/ObjectList<E>)` Adds all the elements in the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#plusAssign(androidx.collection.ObjectList)` set into this set. | Cmn android N JS |
| `operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#plusAssign(androidx.collection.OrderedScatterSet)(elements: https://developer.android.com/reference/kotlin/androidx/collection/OrderedScatterSet<E>)` Adds all the elements in the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#plusAssign(androidx.collection.OrderedScatterSet)` set into this set. | Cmn android N JS |
| `operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#plusAssign(androidx.collection.ScatterSet)(elements: https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet<E>)` Adds all the elements in the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#plusAssign(androidx.collection.ScatterSet)` set into this set. | Cmn android N JS |
| `operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#plusAssign(kotlin.sequences.Sequence)(elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.sequences/-sequence/index.html<E>)` Adds all the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#plusAssign(kotlin.sequences.Sequence)` into this set. | Cmn android N JS |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#remove(kotlin.Any)(element: E)` Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#remove(kotlin.Any)` from the set. | Cmn android N JS |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#removeAll(kotlin.Array)(elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<E>)` Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#removeAll(kotlin.Array)` from the set, if present. | Cmn android N JS |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#removeAll(kotlin.collections.Iterable)(elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterable/index.html<E>)` Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#removeAll(kotlin.collections.Iterable)` from the set, if present. | Cmn android N JS |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#removeAll(androidx.collection.ObjectList)(elements: https://developer.android.com/reference/kotlin/androidx/collection/ObjectList<E>)` Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#removeAll(androidx.collection.ObjectList)` from the set, if present. | Cmn android N JS |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#removeAll(androidx.collection.OrderedScatterSet)(elements: https://developer.android.com/reference/kotlin/androidx/collection/OrderedScatterSet<E>)` Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#removeAll(androidx.collection.OrderedScatterSet)` from the set, if present. | Cmn android N JS |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#removeAll(androidx.collection.ScatterSet)(elements: https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet<E>)` Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#removeAll(androidx.collection.ScatterSet)` from the set, if present. | Cmn android N JS |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#removeAll(kotlin.sequences.Sequence)(elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.sequences/-sequence/index.html<E>)` Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#removeAll(kotlin.sequences.Sequence)` from the set, if present. | Cmn android N JS |
| `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#removeIf(kotlin.Function1)(predicate: (E) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Removes any values for which the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#removeIf(kotlin.Function1)` returns true. | Cmn android N JS |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#retainAll(kotlin.collections.Collection)(elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html<E>)` Removes all the entries in this set that are not contained in `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#retainAll(kotlin.collections.Collection)`. | Cmn android N JS |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#retainAll(androidx.collection.OrderedScatterSet)(elements: https://developer.android.com/reference/kotlin/androidx/collection/OrderedScatterSet<E>)` Removes all the entries in this set that are not contained in `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#retainAll(androidx.collection.OrderedScatterSet)`. | Cmn android N JS |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#retainAll(androidx.collection.ScatterSet)(elements: https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet<E>)` Removes all the entries in this set that are not contained in `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#retainAll(androidx.collection.ScatterSet)`. | Cmn android N JS |
| `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#retainAll(kotlin.Function1)(predicate: (E) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Removes all the elements in this set for which the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#retainAll(kotlin.Function1)` is `true`. | Cmn android N JS |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#trim()()` Trims this `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet`'s storage so it is sized appropriately to hold the current elements. | Cmn android N JS |

### Inherited functions

From [androidx.collection.ScatterSet](https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet) `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet#all(kotlin.Function1)(predicate: (element) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

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

Returns `true` if this set has at least one element.
Cmn android N JS `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet#any(kotlin.Function1)(predicate: (element) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

Returns true if at least one element matches the given `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet#any(kotlin.Function1)`.
Cmn android N JS `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<E>` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet#asSet()()`

Wraps this `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet` with a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/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/ScatterSet#contains(kotlin.Any)(element: E)`

Returns true if the specified `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet#contains(kotlin.Any)` is present in this hash set, false otherwise.
Cmn android N JS `@https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet#count()()`

Returns the number of elements in this set.
Cmn android N JS `inline @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet#count(kotlin.Function1)(predicate: (element) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

Returns the number of elements matching the given `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet#count(kotlin.Function1)`.
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/ScatterSet#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/ScatterSet#equals(kotlin.Any)` with this hash set for equality.
Cmn android N JS `E` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet#first()()`

Returns the first element in the collection.
Cmn android N JS `inline E` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet#first(kotlin.Function1)(predicate: (element) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

Returns the first element in the collection for which `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet#first(kotlin.Function1)` returns `true`
Cmn android N JS `inline E?` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet#firstOrNull(kotlin.Function1)(predicate: (element) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

Returns the first element in the collection for which `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet#firstOrNull(kotlin.Function1)` returns `true` or `null` if there are no elements that match `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet#firstOrNull(kotlin.Function1)`.
Cmn android N JS `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet#forEach(kotlin.Function1)(block: (element) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)`

Iterates over every element stored in this set by invoking the specified `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet#forEach(kotlin.Function1)` lambda.
Cmn android N JS `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet#hashCode()()`

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

Indicates whether this set 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/ScatterSet#isNotEmpty()()`

Returns `true` if this set 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/ScatterSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function1)(
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: ((E) -> 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/ScatterSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function1)` and using `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function1)` before and `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function1)` 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/ScatterSet#none()()`

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

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

### Inherited properties

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

Returns the number of elements that can be stored in this set 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/ScatterSet#size()`

Returns the number of elements in this set.
Cmn android N JS

## Public constructors

### MutableScatterSet

Cmn android N JS

```
<E : Any?> MutableScatterSet(initialCapacity: Int = DefaultScatterCapacity)
```

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

| 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 elements without requiring any allocations. The initial capacity can be set to 0. |

## Public functions

### add

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

```
fun add(element: E): Boolean
```

Adds the specified element to the set.

| Parameters |
|---|---|
| `element: E` | The element to add to the set. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if the element has been added or `false` if the element is already contained within the set. |

### addAll

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

```
fun addAll(elements: Array<E>): Boolean
```

Adds all the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#addAll(kotlin.Array)` into this set.

| Parameters |
|---|---|
| `elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<E>` | An array of elements to add to the set. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if any of the specified elements were added to the collection, `false` if the collection was not modified. |

### addAll

Cmn android N JS

```
fun addAll(elements: Iterable<E>): Boolean
```

Adds all the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#addAll(kotlin.collections.Iterable)` into this set.

| Parameters |
|---|---|
| `elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterable/index.html<E>` | Iterable elements to add to the set. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if any of the specified elements were added to the collection, `false` if the collection was not modified. |

### addAll

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

```
fun addAll(elements: ObjectList<E>): Boolean
```

Adds all the elements in the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#addAll(androidx.collection.ObjectList)` set into this set.

| Parameters |
|---|---|
| `elements: https://developer.android.com/reference/kotlin/androidx/collection/ObjectList<E>` | An `https://developer.android.com/reference/kotlin/androidx/collection/ObjectList` whose elements are to be added to the set |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if any of the specified elements were added to the collection, `false` if the collection was not modified. |

### addAll

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

```
fun addAll(elements: OrderedScatterSet<E>): Boolean
```

Adds all the elements in the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#addAll(androidx.collection.OrderedScatterSet)` set into this set.

| Parameters |
|---|---|
| `elements: https://developer.android.com/reference/kotlin/androidx/collection/OrderedScatterSet<E>` | A `https://developer.android.com/reference/kotlin/androidx/collection/OrderedScatterSet` whose elements are to be added to the set |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if any of the specified elements were added to the collection, `false` if the collection was not modified. |

### addAll

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

```
fun addAll(elements: ScatterSet<E>): Boolean
```

Adds all the elements in the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#addAll(androidx.collection.ScatterSet)` set into this set.

| Parameters |
|---|---|
| `elements: https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet<E>` | A `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet` whose elements are to be added to the set |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if any of the specified elements were added to the collection, `false` if the collection was not modified. |

### addAll

Cmn android N JS

```
fun addAll(elements: Sequence<E>): Boolean
```

Adds all the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#addAll(kotlin.sequences.Sequence)` into this set.

| Parameters |
|---|---|
| `elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.sequences/-sequence/index.html<E>` | The sequence of elements to add to the set. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if any of the specified elements were added to the collection, `false` if the collection was not modified. |

### asMutableSet

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

```
fun asMutableSet(): MutableSet<E>
```

Wraps this `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet` with a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html` interface. The `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html` is backed by the `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet`, so changes to the `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet` are reflected in the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html` and vice-versa. If the `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet` is modified while an iteration over the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/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/MutableScatterSet` with APIs accepting `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html` interfaces, it is less efficient to do so than to use `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet`'s APIs directly. While the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/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-set/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 elements from this set.

### minusAssign

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

```
operator fun minusAssign(element: E): Unit
```

Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#minusAssign(kotlin.Any)` from the set if it is present.

| Parameters |
|---|---|
| `element: E` | The element to be removed from the set. |

### minusAssign

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

```
operator fun minusAssign(elements: Array<E>): Unit
```

Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#minusAssign(kotlin.Array)` from the set, if present.

| Parameters |
|---|---|
| `elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<E>` | An array of elements to be removed from the set. |

### minusAssign

Cmn android N JS

```
operator fun minusAssign(elements: Iterable<E>): Unit
```

Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#minusAssign(kotlin.collections.Iterable)` from the set, if present.

| Parameters |
|---|---|
| `elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterable/index.html<E>` | A Iterable of elements to be removed from the set. |

### minusAssign

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

```
operator fun minusAssign(elements: ObjectList<E>): Unit
```

Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#minusAssign(androidx.collection.ObjectList)` from the set, if present.

| Parameters |
|---|---|
| `elements: https://developer.android.com/reference/kotlin/androidx/collection/ObjectList<E>` | An `https://developer.android.com/reference/kotlin/androidx/collection/ObjectList` whose elements should be removed from the set. |

### minusAssign

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

```
operator fun minusAssign(elements: OrderedScatterSet<E>): Unit
```

Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#minusAssign(androidx.collection.OrderedScatterSet)` from the set, if present.

| Parameters |
|---|---|
| `elements: https://developer.android.com/reference/kotlin/androidx/collection/OrderedScatterSet<E>` | A `https://developer.android.com/reference/kotlin/androidx/collection/OrderedScatterSet` whose elements should be removed from the set. |

### minusAssign

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

```
operator fun minusAssign(elements: ScatterSet<E>): Unit
```

Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#minusAssign(androidx.collection.ScatterSet)` from the set, if present.

| Parameters |
|---|---|
| `elements: https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet<E>` | A `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet` whose elements should be removed from the set. |

### minusAssign

Cmn android N JS

```
operator fun minusAssign(elements: Sequence<E>): Unit
```

Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#minusAssign(kotlin.sequences.Sequence)` from the set, if present.

| Parameters |
|---|---|
| `elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.sequences/-sequence/index.html<E>` | A sequence of elements to be removed from the set. |

### plusAssign

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

```
operator fun plusAssign(element: E): Unit
```

Adds the specified element to the set.

| Parameters |
|---|---|
| `element: E` | The element to add to the set. |

### plusAssign

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

```
operator fun plusAssign(elements: Array<E>): Unit
```

Adds all the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#plusAssign(kotlin.Array)` into this set.

| Parameters |
|---|---|
| `elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<E>` | An array of elements to add to the set. |

### plusAssign

Cmn android N JS

```
operator fun plusAssign(elements: Iterable<E>): Unit
```

Adds all the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#plusAssign(kotlin.collections.Iterable)` into this set.

| Parameters |
|---|---|
| `elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterable/index.html<E>` | Iterable elements to add to the set. |

### plusAssign

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

```
operator fun plusAssign(elements: ObjectList<E>): Unit
```

Adds all the elements in the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#plusAssign(androidx.collection.ObjectList)` set into this set.

| Parameters |
|---|---|
| `elements: https://developer.android.com/reference/kotlin/androidx/collection/ObjectList<E>` | An `https://developer.android.com/reference/kotlin/androidx/collection/ObjectList` whose elements are to be added to the set |

### plusAssign

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

```
operator fun plusAssign(elements: OrderedScatterSet<E>): Unit
```

Adds all the elements in the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#plusAssign(androidx.collection.OrderedScatterSet)` set into this set.

| Parameters |
|---|---|
| `elements: https://developer.android.com/reference/kotlin/androidx/collection/OrderedScatterSet<E>` | A `https://developer.android.com/reference/kotlin/androidx/collection/OrderedScatterSet` whose elements are to be added to the set |

### plusAssign

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

```
operator fun plusAssign(elements: ScatterSet<E>): Unit
```

Adds all the elements in the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#plusAssign(androidx.collection.ScatterSet)` set into this set.

| Parameters |
|---|---|
| `elements: https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet<E>` | A `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet` whose elements are to be added to the set |

### plusAssign

Cmn android N JS

```
operator fun plusAssign(elements: Sequence<E>): Unit
```

Adds all the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#plusAssign(kotlin.sequences.Sequence)` into this set.

| Parameters |
|---|---|
| `elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.sequences/-sequence/index.html<E>` | The sequence of elements to add to the set. |

### remove

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

```
fun remove(element: E): Boolean
```

Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#remove(kotlin.Any)` from the set.

| Parameters |
|---|---|
| `element: E` | The element to be removed from the set. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if the `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#remove(kotlin.Any)` was present in the set, or `false` if it wasn't present before removal. |

### removeAll

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

```
fun removeAll(elements: Array<E>): Boolean
```

Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#removeAll(kotlin.Array)` from the set, if present.

| Parameters |
|---|---|
| `elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<E>` | An array of elements to be removed from the set. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if the set was changed or `false` if none of the elements were present. |

### removeAll

Cmn android N JS

```
fun removeAll(elements: Iterable<E>): Boolean
```

Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#removeAll(kotlin.collections.Iterable)` from the set, if present.

| Parameters |
|---|---|
| `elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterable/index.html<E>` | A Iterable of elements to be removed from the set. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if the set was changed or `false` if none of the elements were present. |

### removeAll

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

```
fun removeAll(elements: ObjectList<E>): Boolean
```

Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#removeAll(androidx.collection.ObjectList)` from the set, if present.

| Parameters |
|---|---|
| `elements: https://developer.android.com/reference/kotlin/androidx/collection/ObjectList<E>` | An `https://developer.android.com/reference/kotlin/androidx/collection/ObjectList` whose elements should be removed from the set. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if the set was changed or `false` if none of the elements were present. |

### removeAll

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

```
fun removeAll(elements: OrderedScatterSet<E>): Boolean
```

Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#removeAll(androidx.collection.OrderedScatterSet)` from the set, if present.

| Parameters |
|---|---|
| `elements: https://developer.android.com/reference/kotlin/androidx/collection/OrderedScatterSet<E>` | A `https://developer.android.com/reference/kotlin/androidx/collection/OrderedScatterSet` whose elements should be removed from the set. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if the set was changed or `false` if none of the elements were present. |

### removeAll

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

```
fun removeAll(elements: ScatterSet<E>): Boolean
```

Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#removeAll(androidx.collection.ScatterSet)` from the set, if present.

| Parameters |
|---|---|
| `elements: https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet<E>` | A `https://developer.android.com/reference/kotlin/androidx/collection/ScatterSet` whose elements should be removed from the set. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if the set was changed or `false` if none of the elements were present. |

### removeAll

Cmn android N JS

```
fun removeAll(elements: Sequence<E>): Boolean
```

Removes the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#removeAll(kotlin.sequences.Sequence)` from the set, if present.

| Parameters |
|---|---|
| `elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.sequences/-sequence/index.html<E>` | A sequence of elements to be removed from the set. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if the set was changed or `false` if none of the elements were present. |

### 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: (E) -> Boolean): Unit
```

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

### retainAll

Cmn android N JS

```
fun retainAll(elements: Collection<E>): Boolean
```

Removes all the entries in this set that are not contained in `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#retainAll(kotlin.collections.Collection)`.

| Parameters |
|---|---|
| `elements: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html<E>` | A collection of elements to preserve in this set. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if this set was modified, `false` otherwise. |

### retainAll

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

```
fun retainAll(elements: OrderedScatterSet<E>): Boolean
```

Removes all the entries in this set that are not contained in `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#retainAll(androidx.collection.OrderedScatterSet)`.

elements A set of elements to preserve in this set.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if this set was modified, `false` otherwise. |

### retainAll

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

```
fun retainAll(elements: ScatterSet<E>): Boolean
```

Removes all the entries in this set that are not contained in `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#retainAll(androidx.collection.ScatterSet)`.

elements A set of elements to preserve in this set.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if this set was modified, `false` otherwise. |

### retainAll

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

```
inline fun retainAll(predicate: (E) -> Boolean): Boolean
```

Removes all the elements in this set for which the specified `https://developer.android.com/reference/kotlin/androidx/collection/MutableScatterSet#retainAll(kotlin.Function1)` is `true`. For each element in the set, the predicate is invoked with that element as the sole parameter.

| Parameters |
|---|---|
| `predicate: (E) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Predicate invoked for each element in the set. When the predicate returns `true`, the element is kept in the set, otherwise it is removed. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if this set was modified, `false` otherwise. |

### trim

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

```
fun trim(): @IntRange(from = 0) Int
```

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

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