# MutableLongSet

# MutableLongSet

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

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/collection/MutableLongSet "View this page in Java")
Common/AllAndroid/JVMNative/C/iOSJavaScript
  - Cmn  

  ```
  class MutableLongSet : LongSet
```  

|---|---|-------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)                                            |||
| ↳ | [androidx.collection.LongSet](https://developer.android.com/reference/kotlin/androidx/collection/LongSet)                  ||
|   | ↳ | [androidx.collection.MutableLongSet](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet) |

*** ** * ** ***

[MutableLongSet](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet)is a container with a[MutableSet](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.

## Summary

|                                                                                                                                                              ### Public constructors                                                                                                                                                              |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| [MutableLongSet](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#MutableLongSet(kotlin.Int))`(initialCapacity: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Creates a new[MutableLongSet](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet) | Cmn |

|                                                                                ### Public functions                                                                                |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                | [add](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#add(kotlin.Long))`(element: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Adds the specified element to the set.                                                                                                                                                                                        | Cmn |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                | [addAll](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#addAll(kotlin.LongArray))`(elements: `[LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)`)` Adds all the[elements](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#addAll(kotlin.LongArray))into this set.                                                       | Cmn |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                | [addAll](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#addAll(androidx.collection.LongSet))`(elements: `[LongSet](https://developer.android.com/reference/kotlin/androidx/collection/LongSet)`)` Adds all the elements in the[elements](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#addAll(androidx.collection.LongSet))set into this set.                | Cmn |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                      | [clear](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#clear())`()` Removes all elements from this set.                                                                                                                                                                                                                                                                                          | Cmn |
| `operator `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                           | [minusAssign](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#minusAssign(kotlin.Long))`(element: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Removes the specified[element](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#minusAssign(kotlin.Long))from the set if it is present.                                      | Cmn |
| `operator `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                           | [minusAssign](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#minusAssign(kotlin.LongArray))`(elements: `[LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)`)` Removes the specified[elements](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#minusAssign(kotlin.LongArray))from the set, if present.                    | Cmn |
| `operator `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                           | [minusAssign](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#minusAssign(androidx.collection.LongSet))`(elements: `[LongSet](https://developer.android.com/reference/kotlin/androidx/collection/LongSet)`)` Removes the specified[elements](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#minusAssign(androidx.collection.LongSet))from the set, if present. | Cmn |
| `operator `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                           | [plusAssign](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#plusAssign(kotlin.Long))`(element: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Adds the specified element to the set.                                                                                                                                                                          | Cmn |
| `operator `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                           | [plusAssign](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#plusAssign(kotlin.LongArray))`(elements: `[LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)`)` Adds all the[elements](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#plusAssign(kotlin.LongArray))into this set.                                           | Cmn |
| `operator `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                           | [plusAssign](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#plusAssign(androidx.collection.LongSet))`(elements: `[LongSet](https://developer.android.com/reference/kotlin/androidx/collection/LongSet)`)` Adds all the elements in the[elements](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#plusAssign(androidx.collection.LongSet))set into this set.    | Cmn |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                | [remove](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#remove(kotlin.Long))`(element: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Removes the specified[element](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#remove(kotlin.Long))from the set.                                                                      | Cmn |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                | [removeAll](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#removeAll(kotlin.LongArray))`(elements: `[LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)`)` Removes the specified[elements](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#removeAll(kotlin.LongArray))from the set, if present.                          | Cmn |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                | [removeAll](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#removeAll(androidx.collection.LongSet))`(elements: `[LongSet](https://developer.android.com/reference/kotlin/androidx/collection/LongSet)`)` Removes the specified[elements](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#removeAll(androidx.collection.LongSet))from the set, if present.       | Cmn |
| `@`[IntRange](https://developer.android.com/reference/kotlin/androidx/annotation/IntRange)`(from = 0) `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [trim](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#trim())`()` Trims this[MutableLongSet](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet)'s storage so it is sized appropriately to hold the current elements.                                                                                                                                             | Cmn |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ### Inherited functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[androidx.collection.LongSet](https://developer.android.com/reference/kotlin/androidx/collection/LongSet) |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----| | `inline `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                              | [all](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#all(kotlin.Function1))`(predicate: (element: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`) `->` `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Returns true if all elements match the given[predicate](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#all(kotlin.Function1)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Cmn | | [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                       | [any](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#any())`()` Returns`true`if this set has at least one element.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | Cmn | | `inline `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                              | [any](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#any(kotlin.Function1))`(predicate: (element: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`) `->` `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Returns true if at least one element matches the given[predicate](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#any(kotlin.Function1)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Cmn | | `operator `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                            | [contains](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#contains(kotlin.Long))`(element: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Returns`true`if the specified[element](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#contains(kotlin.Long))is present in this set,`false`otherwise.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | Cmn | | `@`[IntRange](https://developer.android.com/reference/kotlin/androidx/annotation/IntRange)`(from = 0) `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)        | [count](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#count())`()` Returns the number of elements in this set.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | Cmn | | `inline @`[IntRange](https://developer.android.com/reference/kotlin/androidx/annotation/IntRange)`(from = 0) `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [count](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#count(kotlin.Function1))`(predicate: (element: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`) `->` `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Returns the number of elements matching the given[predicate](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#count(kotlin.Function1)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Cmn | | `open operator `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                       | [equals](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#equals(kotlin.Any))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)` Compares the specified object[other](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#equals(kotlin.Any))with this set for equality.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Cmn | | `inline `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                                                                                    | [first](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#first())`()` Returns the first element in the collection.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | Cmn | | `inline `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                                                                                    | [first](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#first(kotlin.Function1))`(predicate: (element: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`) `->` `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Returns the first element in the collection for which[predicate](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#first(kotlin.Function1))returns`true`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Cmn | | `inline `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                    | [forEach](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#forEach(kotlin.Function1))`(block: (element: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`) `->` `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)`)` Iterates over every element stored in this set by invoking the specified[block](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#forEach(kotlin.Function1))lambda.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Cmn | | `open `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                        | [hashCode](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#hashCode())`()` Returns the hash code value for this set.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Cmn | | [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                       | [isEmpty](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#isEmpty())`()` Indicates whether this set is empty.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | Cmn | | [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                       | [isNotEmpty](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#isNotEmpty())`()` Returns`true`if this set is not empty.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Cmn | | [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                                                                                         | [joinToString](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence))`(` ` separator: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`,` ` prefix: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`,` ` postfix: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`,` ` limit: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` truncated: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html) `)` Creates a String from the elements separated by[separator](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence))and using[prefix](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence))before and[postfix](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence))after, if supplied.                                                                                                                                                                                                                                                                                        | Cmn | | `inline `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                                                                                | [joinToString](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function1))`(` ` separator: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`,` ` prefix: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`,` ` postfix: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`,` ` limit: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` truncated: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`,` ` crossinline transform: (`[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`) `->` `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html) `)` Creates a String from the elements separated by[separator](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function1))and using[prefix](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function1))before and[postfix](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function1))after, if supplied. | Cmn | | [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                       | [none](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#none())`()` Returns`true`if this set has no elements.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | Cmn | | `open `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                                                                                  | [toString](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#toString())`()` Returns a string representation of this set.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Cmn | |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ### Inherited properties                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[androidx.collection.LongSet](https://developer.android.com/reference/kotlin/androidx/collection/LongSet) |-----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----| | [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [capacity](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#capacity()) Returns the number of elements that can be stored in this set without requiring internal storage reallocation. | Cmn | | [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [size](https://developer.android.com/reference/kotlin/androidx/collection/LongSet#size()) Returns the number of elements in this set.                                                                            | Cmn | |

## Public constructors

### MutableLongSet

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

```
MutableLongSet(initialCapacity: Int = DefaultScatterCapacity)
```

Creates a new[MutableLongSet](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet)  

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

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

Adds the specified element to the set.  

|                                        Parameters                                        |
|------------------------------------------------------------------------------------------|--------------------------------|
| `element: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The element to add to the set. |

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

```
fun addAll(elements: LongArray): Boolean
```

Adds all the[elements](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#addAll(kotlin.LongArray))into this set.  

|                                              Parameters                                              |
|------------------------------------------------------------------------------------------------------|-----------------------------------------|
| `elements: `[LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) | An array of elements to add to the set. |

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

```
fun addAll(elements: LongSet): Boolean
```

Adds all the elements in the[elements](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#addAll(androidx.collection.LongSet))set into this set.  

|                                            Parameters                                             |
|---------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|
| `elements: `[LongSet](https://developer.android.com/reference/kotlin/androidx/collection/LongSet) | A[LongSet](https://developer.android.com/reference/kotlin/androidx/collection/LongSet)of elements to add to this set. |

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------|
| [Boolean](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. |

### clear

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

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

Removes the specified[element](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#minusAssign(kotlin.Long))from the set if it is present.  

|                                        Parameters                                        |
|------------------------------------------------------------------------------------------|-------------------------------------|
| `element: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The element to remove from the set. |

### minusAssign

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

```
operator fun minusAssign(elements: LongArray): Unit
```

Removes the specified[elements](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#minusAssign(kotlin.LongArray))from the set, if present.  

|                                              Parameters                                              |
|------------------------------------------------------------------------------------------------------|--------------------------------------------------|
| `elements: `[LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) | An array of elements to be removed from the set. |

### minusAssign

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

```
operator fun minusAssign(elements: LongSet): Unit
```

Removes the specified[elements](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#minusAssign(androidx.collection.LongSet))from the set, if present.  

|                                            Parameters                                             |
|---------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|
| `elements: `[LongSet](https://developer.android.com/reference/kotlin/androidx/collection/LongSet) | An[LongSet](https://developer.android.com/reference/kotlin/androidx/collection/LongSet)of elements to be removed from the set. |

### plusAssign

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

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

Adds the specified element to the set.  

|                                        Parameters                                        |
|------------------------------------------------------------------------------------------|--------------------------------|
| `element: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The element to add to the set. |

### plusAssign

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

```
operator fun plusAssign(elements: LongArray): Unit
```

Adds all the[elements](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#plusAssign(kotlin.LongArray))into this set.  

|                                              Parameters                                              |
|------------------------------------------------------------------------------------------------------|-----------------------------------------|
| `elements: `[LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) | An array of elements to add to the set. |

### plusAssign

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

```
operator fun plusAssign(elements: LongSet): Unit
```

Adds all the elements in the[elements](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#plusAssign(androidx.collection.LongSet))set into this set.  

|                                            Parameters                                             |
|---------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|
| `elements: `[LongSet](https://developer.android.com/reference/kotlin/androidx/collection/LongSet) | A[LongSet](https://developer.android.com/reference/kotlin/androidx/collection/LongSet)of elements to add to this set. |

### remove

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

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

Removes the specified[element](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#remove(kotlin.Long))from the set.  

|                                        Parameters                                        |
|------------------------------------------------------------------------------------------|-------------------------------------|
| `element: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The element to remove from the set. |

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

### removeAll

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

```
fun removeAll(elements: LongArray): Boolean
```

Removes the specified[elements](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#removeAll(kotlin.LongArray))from the set, if present.  

|                                              Parameters                                              |
|------------------------------------------------------------------------------------------------------|--------------------------------------------------|
| `elements: `[LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) | An array of elements to be removed from the set. |

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

```
fun removeAll(elements: LongSet): Boolean
```

Removes the specified[elements](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet#removeAll(androidx.collection.LongSet))from the set, if present.  

|                                            Parameters                                             |
|---------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|
| `elements: `[LongSet](https://developer.android.com/reference/kotlin/androidx/collection/LongSet) | An[LongSet](https://developer.android.com/reference/kotlin/androidx/collection/LongSet)of elements to be removed from the set. |

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| [Boolean](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. |

### trim

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

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

Trims this[MutableLongSet](https://developer.android.com/reference/kotlin/androidx/collection/MutableLongSet)'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.