# MutableLongObjectMap

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

*** ** * ** ***


```
public final class MutableLongObjectMap<V extends Object> extends LongObjectMap<@NonNull V>
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.collection.LongObjectMap](https://developer.android.com/reference/androidx/collection/LongObjectMap)\<@[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull) V\> ||
|   | ↳ | [androidx.collection.MutableLongObjectMap](https://developer.android.com/reference/androidx/collection/MutableLongObjectMap) |

*** ** * ** ***

`https://developer.android.com/reference/androidx/collection/MutableLongObjectMap` is a container with a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html`-like interface for keys with `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` primitives and reference type values.

The underlying implementation is designed to avoid allocations from boxing, and insertion, removal, retrieval, and iteration operations. Allocations may still happen on insertion when the underlying storage needs to grow to accommodate newly added entries to the table. In addition, this implementation minimizes memory usage by avoiding the use of separate objects to hold key/value pairs.

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

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

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

## Summary

| ### Public constructors |
|---|
| `<V extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#MutableLongObjectMap(kotlin.Int)(int initialCapacity)` Creates a new `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap` |

| ### Public methods |
|---|---|
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#clear()()` Removes all mappings from this map. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull V` | `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#getOrPut(kotlin.Long,kotlin.Function0)(long key, @https://developer.android.com/reference/androidx/annotation/NonNull Function0<@https://developer.android.com/reference/androidx/annotation/NonNull V> defaultValue)` Returns the value to which the specified `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#getOrPut(kotlin.Long,kotlin.Function0)` is mapped, if the value is present in the map and not `null`. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#minusAssign(kotlin.Long)(long key)` Removes the specified `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#minusAssign(kotlin.Long)` and its associated value from the map. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#minusAssign(kotlin.LongArray)(@https://developer.android.com/reference/androidx/annotation/NonNull long[] keys)` Removes the specified `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#minusAssign(kotlin.LongArray)` and their associated value from the map. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#minusAssign(androidx.collection.LongList)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/LongList keys)` Removes the specified `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#minusAssign(androidx.collection.LongList)` and their associated value from the map. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#minusAssign(androidx.collection.LongSet)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/LongSet keys)` Removes the specified `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#minusAssign(androidx.collection.LongSet)` and their associated value from the map. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#plusAssign(androidx.collection.LongObjectMap)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/LongObjectMap<@https://developer.android.com/reference/androidx/annotation/NonNull V> from)` Puts all the key/value mappings in the `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#plusAssign(androidx.collection.LongObjectMap)` map into this map. |
| `final V` | `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#put(kotlin.Long,kotlin.Any)(long key, @https://developer.android.com/reference/androidx/annotation/NonNull V value)` Creates a new mapping from `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#put(kotlin.Long,kotlin.Any)` to `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#put(kotlin.Long,kotlin.Any)` in this map. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#putAll(androidx.collection.LongObjectMap)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/LongObjectMap<@https://developer.android.com/reference/androidx/annotation/NonNull V> from)` Puts all the key/value mappings in the `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#putAll(androidx.collection.LongObjectMap)` map into this map. |
| `final V` | `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#remove(kotlin.Long)(long key)` Removes the specified `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#remove(kotlin.Long)` and its associated value from the map. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#remove(kotlin.Long,kotlin.Any)(long key, @https://developer.android.com/reference/androidx/annotation/NonNull V value)` Removes the specified `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#remove(kotlin.Long,kotlin.Any)` and its associated value from the map if the associated value equals `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#remove(kotlin.Long,kotlin.Any)`. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#removeIf(kotlin.Function2)( @https://developer.android.com/reference/androidx/annotation/NonNull Function2<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Long.html, @https://developer.android.com/reference/androidx/annotation/NonNull V, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html> predicate )` Removes any mapping for which the specified `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#removeIf(kotlin.Function2)` returns true. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#set(kotlin.Long,kotlin.Any)(long key, @https://developer.android.com/reference/androidx/annotation/NonNull V value)` Creates a new mapping from `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#set(kotlin.Long,kotlin.Any)` to `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#set(kotlin.Long,kotlin.Any)` in this map. |
| `final int` | `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap#trim()()` Trims this `https://developer.android.com/reference/androidx/collection/MutableLongObjectMap`'s storage so it is sized appropriately to hold the current mappings. |

### Inherited methods

From [androidx.collection.LongObjectMap](https://developer.android.com/reference/androidx/collection/LongObjectMap) `final boolean` `https://developer.android.com/reference/androidx/collection/LongObjectMap#all(kotlin.Function2)(@https://developer.android.com/reference/androidx/annotation/NonNull Function2<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Long.html, @https://developer.android.com/reference/androidx/annotation/NonNull V, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html> predicate)`

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

Returns `true` if this map has at least one entry.
`final boolean` `https://developer.android.com/reference/androidx/collection/LongObjectMap#any(kotlin.Function2)(@https://developer.android.com/reference/androidx/annotation/NonNull Function2<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Long.html, @https://developer.android.com/reference/androidx/annotation/NonNull V, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html> predicate)`

Returns true if at least one entry matches the given `https://developer.android.com/reference/androidx/collection/LongObjectMap#any(kotlin.Function2)`.
`final boolean` `https://developer.android.com/reference/androidx/collection/LongObjectMap#contains(kotlin.Long)(long key)`

Returns true if the specified `https://developer.android.com/reference/androidx/collection/LongObjectMap#contains(kotlin.Long)` is present in this map, false otherwise.
`final boolean` `https://developer.android.com/reference/androidx/collection/LongObjectMap#containsKey(kotlin.Long)(long key)`

Returns true if the specified `https://developer.android.com/reference/androidx/collection/LongObjectMap#containsKey(kotlin.Long)` is present in this map, false otherwise.
`final boolean` `https://developer.android.com/reference/androidx/collection/LongObjectMap#containsValue(kotlin.Any)(@https://developer.android.com/reference/androidx/annotation/NonNull V value)`

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

Returns the number of entries in this map.
`final int` `https://developer.android.com/reference/androidx/collection/LongObjectMap#count(kotlin.Function2)(
@https://developer.android.com/reference/androidx/annotation/NonNull Function2<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Long.html, @https://developer.android.com/reference/androidx/annotation/NonNull V, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html> predicate
)`

Returns the number of entries matching the given `https://developer.android.com/reference/androidx/collection/LongObjectMap#count(kotlin.Function2)`.
`boolean` `https://developer.android.com/reference/androidx/collection/LongObjectMap#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)`

Compares the specified object `https://developer.android.com/reference/androidx/collection/LongObjectMap#equals(kotlin.Any)` with this hash map for equality.
`final void` `https://developer.android.com/reference/androidx/collection/LongObjectMap#forEach(kotlin.Function2)(@https://developer.android.com/reference/androidx/annotation/NonNull Function2<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Long.html, @https://developer.android.com/reference/androidx/annotation/NonNull value, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> block)`

Iterates over every key/value pair stored in this map by invoking the specified `https://developer.android.com/reference/androidx/collection/LongObjectMap#forEach(kotlin.Function2)` lambda.
`final void` `https://developer.android.com/reference/androidx/collection/LongObjectMap#forEachKey(kotlin.Function1)(@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Long.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> block)`

Iterates over every key stored in this map by invoking the specified `https://developer.android.com/reference/androidx/collection/LongObjectMap#forEachKey(kotlin.Function1)` lambda.
`final void` `https://developer.android.com/reference/androidx/collection/LongObjectMap#forEachValue(kotlin.Function1)(@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull value, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> block)`

Iterates over every value stored in this map by invoking the specified `https://developer.android.com/reference/androidx/collection/LongObjectMap#forEachValue(kotlin.Function1)` lambda.
`final V` `https://developer.android.com/reference/androidx/collection/LongObjectMap#get(kotlin.Long)(long key)`

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

Returns the number of key-value pairs that can be stored in this map without requiring internal storage reallocation.
`final @https://developer.android.com/reference/androidx/annotation/NonNull V` `https://developer.android.com/reference/androidx/collection/LongObjectMap#getOrDefault(kotlin.Long,kotlin.Any)(long key, @https://developer.android.com/reference/androidx/annotation/NonNull V defaultValue)`

Returns the value to which the specified `https://developer.android.com/reference/androidx/collection/LongObjectMap#getOrDefault(kotlin.Long,kotlin.Any)` is mapped, or `https://developer.android.com/reference/androidx/collection/LongObjectMap#getOrDefault(kotlin.Long,kotlin.Any)` if this map contains no mapping for the key.
`final @https://developer.android.com/reference/androidx/annotation/NonNull V` `https://developer.android.com/reference/androidx/collection/LongObjectMap#getOrElse(kotlin.Long,kotlin.Function0)(long key, @https://developer.android.com/reference/androidx/annotation/NonNull Function0<@https://developer.android.com/reference/androidx/annotation/NonNull V> defaultValue)`

Returns the value for the given `https://developer.android.com/reference/androidx/collection/LongObjectMap#getOrElse(kotlin.Long,kotlin.Function0)` if the value is present and not null.
`final int` `https://developer.android.com/reference/androidx/collection/LongObjectMap#getSize()()`

Returns the number of key-value pairs in this map.
`int` `https://developer.android.com/reference/androidx/collection/LongObjectMap#hashCode()()`

Returns the hash code value for this map.
`final boolean` `https://developer.android.com/reference/androidx/collection/LongObjectMap#isEmpty()()`

Indicates whether this map is empty.
`final boolean` `https://developer.android.com/reference/androidx/collection/LongObjectMap#isNotEmpty()()`

Returns `true` if this map is not empty.
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/collection/LongObjectMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence)(
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html separator,
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html prefix,
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html postfix,
int limit,
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html truncated
)`

Creates a String from the entries, separated by `https://developer.android.com/reference/androidx/collection/LongObjectMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence)` and using `https://developer.android.com/reference/androidx/collection/LongObjectMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence)` before and `https://developer.android.com/reference/androidx/collection/LongObjectMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence)` after, if supplied.
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/collection/LongObjectMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2)(
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html separator,
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html prefix,
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html postfix,
int limit,
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html truncated,
@https://developer.android.com/reference/androidx/annotation/NonNull Function2<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Long.html, @https://developer.android.com/reference/androidx/annotation/NonNull value, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html> transform
)`

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

Returns `true` if this map has no entries.
`@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/collection/LongObjectMap#toString()()`

Returns a string representation of this map.

## Public constructors

### MutableLongObjectMap

```
public <V extends Object> MutableLongObjectMap(int initialCapacity)
```

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

| Parameters |
|---|---|
| `int initialCapacity` | The initial desired capacity for this container. the container will honor this value by guaranteeing its internal structures can hold that many entries without requiring any allocations. The initial capacity can be set to 0. |

## Public methods

### clear

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

```
public final void clear()
```

Removes all mappings from this map.

### getOrPut

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

```
public final @NonNull V getOrPut(long key, @NonNull Function0<@NonNull V> defaultValue)
```

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

### minusAssign

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

```
public final void minusAssign(long key)
```

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

### minusAssign

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

```
public final void minusAssign(@NonNull long[] keys)
```

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

### minusAssign

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

```
public final void minusAssign(@NonNull LongList keys)
```

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

### minusAssign

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

```
public final void minusAssign(@NonNull LongSet keys)
```

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

### plusAssign

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

```
public final void plusAssign(@NonNull LongObjectMap<@NonNull V> from)
```

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

### put

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

```
public final V put(long key, @NonNull V value)
```

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

### putAll

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

```
public final void putAll(@NonNull LongObjectMap<@NonNull V> from)
```

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

### remove

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

```
public final V remove(long key)
```

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

### remove

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

```
public final boolean remove(long key, @NonNull V value)
```

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

### removeIf

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

```
public final void removeIf(
    @NonNull Function2<@NonNull Long, @NonNull V, @NonNull Boolean> predicate
)
```

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

### set

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

```
public final void set(long key, @NonNull V value)
```

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

### trim

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

```
public final int trim()
```

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

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