# MutableObjectList

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

*** ** * ** ***


```
public final class MutableObjectList<E extends Object> extends ObjectList<@NonNull E>
```

<br />

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

*** ** * ** ***

`https://developer.android.com/reference/androidx/collection/MutableObjectList` is a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html`-like collection for reference types. It is optimized for fast access, avoiding virtual and interface method access. Methods avoid allocation whenever possible. For example `https://developer.android.com/reference/androidx/collection/MutableObjectList#forEach(kotlin.Function1)` does not need allocate an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterator/index.html`.

This implementation is not thread-safe: if multiple threads access this container concurrently, and one or more threads modify the structure of the list (insertion or removal for instance), the calling code must provide the appropriate synchronization. It is also not safe to mutate during reentrancy -- in the middle of a `https://developer.android.com/reference/androidx/collection/MutableObjectList#forEach(kotlin.Function1)`, for example. However, concurrent reads are safe.

**Note** `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html` access is available through `https://developer.android.com/reference/androidx/collection/MutableObjectList#asList()` when developers need access to the common API.

**Note** `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html` access is available through `https://developer.android.com/reference/androidx/collection/MutableObjectList#asMutableList()` when developers need access to the common API.

It is best to use this for all internal implementations where a list of reference types is needed. Use `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html` in public API to take advantage of the commonly-used interface. It is common to use `https://developer.android.com/reference/androidx/collection/MutableObjectList` internally and use `https://developer.android.com/reference/androidx/collection/MutableObjectList#asMutableList()` or `https://developer.android.com/reference/androidx/collection/MutableObjectList#asList()` to get a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html` or `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html` interface for interacting with public APIs.

MutableLongList

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/collection/ObjectList` |   |
| `https://developer.android.com/reference/androidx/collection/MutableFloatList` |   |
| `https://developer.android.com/reference/androidx/collection/MutableIntList` |   |

## Summary

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

| ### Public methods |
|---|---|
| `final boolean` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#add(kotlin.Any)(@https://developer.android.com/reference/androidx/annotation/NonNull E element)` Adds `https://developer.android.com/reference/androidx/collection/MutableObjectList#add(kotlin.Any)` to the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true`. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#add(kotlin.Int,kotlin.Any)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int index, @https://developer.android.com/reference/androidx/annotation/NonNull E element)` Adds `https://developer.android.com/reference/androidx/collection/MutableObjectList#add(kotlin.Int,kotlin.Any)` to the `https://developer.android.com/reference/androidx/collection/MutableObjectList` at the given `https://developer.android.com/reference/androidx/collection/MutableObjectList#add(kotlin.Int,kotlin.Any)`, shifting over any elements at `https://developer.android.com/reference/androidx/collection/MutableObjectList#add(kotlin.Int,kotlin.Any)` and after, if any. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Array)(@https://developer.android.com/reference/androidx/annotation/NonNull E[] elements)` Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Array)` to the end of the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true` if the `https://developer.android.com/reference/androidx/collection/MutableObjectList` was changed or `false` if `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Array)` was empty. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.collections.Iterable)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Iterable.html<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.collections.Iterable)` to the end of the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true` if the `https://developer.android.com/reference/androidx/collection/MutableObjectList` was changed or `false` if `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.collections.Iterable)` was empty. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.collections.List)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.collections.List)` to the end of the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true` if the `https://developer.android.com/reference/androidx/collection/MutableObjectList` was changed or `false` if `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.collections.List)` was empty. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(androidx.collection.ObjectList)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/ObjectList<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(androidx.collection.ObjectList)` to the end of the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true` if the `https://developer.android.com/reference/androidx/collection/MutableObjectList` was changed or `false` if `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(androidx.collection.ObjectList)` was empty. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(androidx.collection.ScatterSet)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/ScatterSet<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(androidx.collection.ScatterSet)` to the end of the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true` if the `https://developer.android.com/reference/androidx/collection/MutableObjectList` was changed or `false` if `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(androidx.collection.ScatterSet)` was empty. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.sequences.Sequence)(@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.sequences/-sequence/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.sequences.Sequence)` to the end of the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true` if the `https://developer.android.com/reference/androidx/collection/MutableObjectList` was changed or `false` if `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.sequences.Sequence)` was empty. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,kotlin.Array)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int index, @https://developer.android.com/reference/androidx/annotation/NonNull E[] elements)` Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,kotlin.Array)` to the `https://developer.android.com/reference/androidx/collection/MutableObjectList` at the given `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,kotlin.Array)`, shifting over any elements at `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,kotlin.Array)` and after, if any. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,kotlin.collections.Collection)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int index, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,kotlin.collections.Collection)` to the `https://developer.android.com/reference/androidx/collection/MutableObjectList` at the given `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,kotlin.collections.Collection)`, shifting over any elements at `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,kotlin.collections.Collection)` and after, if any. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,androidx.collection.ObjectList)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int index, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/ObjectList<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,androidx.collection.ObjectList)` to the `https://developer.android.com/reference/androidx/collection/MutableObjectList` at the given `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,androidx.collection.ObjectList)`, shifting over any elements at `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,androidx.collection.ObjectList)` and after, if any. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull E>` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#asList()()` Returns a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html` view into the `https://developer.android.com/reference/androidx/collection/ObjectList`. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull E>` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#asMutableList()()` Returns a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html` view into the `https://developer.android.com/reference/androidx/collection/MutableObjectList`. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#clear()()` Removes all elements in the `https://developer.android.com/reference/androidx/collection/MutableObjectList`. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#ensureCapacity(kotlin.Int)(int capacity)` Ensures that there is enough space to store `https://developer.android.com/reference/androidx/collection/MutableObjectList#ensureCapacity(kotlin.Int)` elements in the `https://developer.android.com/reference/androidx/collection/MutableObjectList`. |
| `final int` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#getCapacity()()` Returns the total number of elements that can be held before the `https://developer.android.com/reference/androidx/collection/MutableObjectList` must grow. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#minusAssign(kotlin.Any)(@https://developer.android.com/reference/androidx/annotation/NonNull E element)` `https://developer.android.com/reference/androidx/collection/MutableObjectList#minusAssign(kotlin.Any)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList` |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#minusAssign(kotlin.Array)(@https://developer.android.com/reference/androidx/annotation/NonNull E[] elements)` Removes all `https://developer.android.com/reference/androidx/collection/MutableObjectList#minusAssign(kotlin.Array)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList`. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#minusAssign(kotlin.collections.Iterable)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Iterable.html<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Removes all `https://developer.android.com/reference/androidx/collection/MutableObjectList#minusAssign(kotlin.collections.Iterable)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList`. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#minusAssign(kotlin.collections.List)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Removes all `https://developer.android.com/reference/androidx/collection/MutableObjectList#minusAssign(kotlin.collections.List)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList`. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#minusAssign(androidx.collection.ObjectList)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/ObjectList<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Removes all `https://developer.android.com/reference/androidx/collection/MutableObjectList#minusAssign(androidx.collection.ObjectList)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList`. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#minusAssign(androidx.collection.ScatterSet)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/ScatterSet<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Removes all `https://developer.android.com/reference/androidx/collection/MutableObjectList#minusAssign(androidx.collection.ScatterSet)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList`. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#minusAssign(kotlin.sequences.Sequence)(@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.sequences/-sequence/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Removes all `https://developer.android.com/reference/androidx/collection/MutableObjectList#minusAssign(kotlin.sequences.Sequence)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList`. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#plusAssign(kotlin.Any)(@https://developer.android.com/reference/androidx/annotation/NonNull E element)` `https://developer.android.com/reference/androidx/collection/MutableObjectList#plusAssign(kotlin.Any)` to the `https://developer.android.com/reference/androidx/collection/MutableObjectList`. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#plusAssign(kotlin.Array)(@https://developer.android.com/reference/androidx/annotation/NonNull E[] elements)` Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#plusAssign(kotlin.Array)` to the end of the `https://developer.android.com/reference/androidx/collection/MutableObjectList`. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#plusAssign(kotlin.collections.Iterable)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Iterable.html<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#plusAssign(kotlin.collections.Iterable)` to the end of the `https://developer.android.com/reference/androidx/collection/MutableObjectList`. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#plusAssign(kotlin.collections.List)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#plusAssign(kotlin.collections.List)` to the end of the `https://developer.android.com/reference/androidx/collection/MutableObjectList`. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#plusAssign(androidx.collection.ObjectList)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/ObjectList<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#plusAssign(androidx.collection.ObjectList)` to the end of the `https://developer.android.com/reference/androidx/collection/MutableObjectList`. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#plusAssign(androidx.collection.ScatterSet)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/ScatterSet<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#plusAssign(androidx.collection.ScatterSet)` to the end of the `https://developer.android.com/reference/androidx/collection/MutableObjectList`. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#plusAssign(kotlin.sequences.Sequence)(@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.sequences/-sequence/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#plusAssign(kotlin.sequences.Sequence)` to the end of the `https://developer.android.com/reference/androidx/collection/MutableObjectList`. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#remove(kotlin.Any)(@https://developer.android.com/reference/androidx/annotation/NonNull E element)` Removes `https://developer.android.com/reference/androidx/collection/MutableObjectList#remove(kotlin.Any)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList`. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeAll(kotlin.Array)(@https://developer.android.com/reference/androidx/annotation/NonNull E[] elements)` Removes all `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeAll(kotlin.Array)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true` if anything was removed. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeAll(kotlin.collections.Iterable)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Iterable.html<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Removes all `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeAll(kotlin.collections.Iterable)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true` if anything was removed. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeAll(kotlin.collections.List)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Removes all `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeAll(kotlin.collections.List)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true` if anything was removed. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeAll(androidx.collection.ObjectList)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/ObjectList<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Removes all `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeAll(androidx.collection.ObjectList)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true` if anything was removed. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeAll(androidx.collection.ScatterSet)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/ScatterSet<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Removes all `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeAll(androidx.collection.ScatterSet)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true` if anything was removed. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeAll(kotlin.sequences.Sequence)(@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.sequences/-sequence/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Removes all `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeAll(kotlin.sequences.Sequence)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true` if anything was removed. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull E` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeAt(kotlin.Int)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int index)` Removes the element at the given `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeAt(kotlin.Int)` and returns it. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeIf(kotlin.Function1)(@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull element, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html> predicate)` Removes all elements in this list for which `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeIf(kotlin.Function1)` returns `true`. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeRange(kotlin.Int,kotlin.Int)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int start, @https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int end)` Removes elements from index `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeRange(kotlin.Int,kotlin.Int)` (inclusive) to `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeRange(kotlin.Int,kotlin.Int)` (exclusive). |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#retainAll(kotlin.Array)(@https://developer.android.com/reference/androidx/annotation/NonNull E[] elements)` Keeps only `https://developer.android.com/reference/androidx/collection/MutableObjectList#retainAll(kotlin.Array)` in the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and removes all other values. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#retainAll(kotlin.collections.Collection)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Keeps only `https://developer.android.com/reference/androidx/collection/MutableObjectList#retainAll(kotlin.collections.Collection)` in the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and removes all other values. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#retainAll(kotlin.collections.Iterable)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Iterable.html<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Keeps only `https://developer.android.com/reference/androidx/collection/MutableObjectList#retainAll(kotlin.collections.Iterable)` in the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and removes all other values. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#retainAll(androidx.collection.ObjectList)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/ObjectList<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Keeps only `https://developer.android.com/reference/androidx/collection/MutableObjectList#retainAll(androidx.collection.ObjectList)` in the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and removes all other values. |
| `final boolean` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#retainAll(kotlin.sequences.Sequence)(@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.sequences/-sequence/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)` Keeps only `https://developer.android.com/reference/androidx/collection/MutableObjectList#retainAll(kotlin.sequences.Sequence)` in the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and removes all other values. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull E` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#set(kotlin.Int,kotlin.Any)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int index, @https://developer.android.com/reference/androidx/annotation/NonNull E element)` Sets the value at `https://developer.android.com/reference/androidx/collection/MutableObjectList#set(kotlin.Int,kotlin.Any)` to `https://developer.android.com/reference/androidx/collection/MutableObjectList#set(kotlin.Int,kotlin.Any)`. |
| `final void` | `<R extends https://developer.android.com/reference/java/lang/Comparable.html<@https://developer.android.com/reference/androidx/annotation/NonNull R>> https://developer.android.com/reference/androidx/collection/MutableObjectList#sortBy(kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull element, R> selector )` Sorts elements in the `https://developer.android.com/reference/androidx/collection/MutableObjectList` in-place using values produced by `https://developer.android.com/reference/androidx/collection/MutableObjectList#sortBy(kotlin.Function1)` in ascending order. |
| `final void` | `<R extends https://developer.android.com/reference/java/lang/Comparable.html<@https://developer.android.com/reference/androidx/annotation/NonNull R>> https://developer.android.com/reference/androidx/collection/MutableObjectList#sortByDescending(kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull element, R> selector )` Sorts elements in the `https://developer.android.com/reference/androidx/collection/MutableObjectList` in-place using values produced by `https://developer.android.com/reference/androidx/collection/MutableObjectList#sortByDescending(kotlin.Function1)` in descending order. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#sortWith(kotlin.Comparator)(@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-comparator/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull E> comparator)` Sorts elements in the `https://developer.android.com/reference/androidx/collection/MutableObjectList` in-place using the specified `https://developer.android.com/reference/androidx/collection/MutableObjectList#sortWith(kotlin.Comparator)`. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#sortWith(kotlin.Function2)( @https://developer.android.com/reference/androidx/annotation/NonNull Function2<@https://developer.android.com/reference/androidx/annotation/NonNull a, @https://developer.android.com/reference/androidx/annotation/NonNull b, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html> comparison )` Sorts elements in the `https://developer.android.com/reference/androidx/collection/MutableObjectList` in-place using the specified `https://developer.android.com/reference/androidx/collection/MutableObjectList#sortWith(kotlin.Function2)` function. |
| `final void` | `https://developer.android.com/reference/androidx/collection/MutableObjectList#trim(kotlin.Int)(int minCapacity)` Reduces the internal storage. |

| ### Extension functions |
|---|---|
| `final void` | `<E extends https://developer.android.com/reference/java/lang/Comparable.html<@https://developer.android.com/reference/androidx/annotation/NonNull E>> https://developer.android.com/reference/androidx/collection/ObjectListKt.https://developer.android.com/reference/androidx/collection/MutableObjectList#(androidx.collection.MutableObjectList).sort()( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/MutableObjectList<@https://developer.android.com/reference/androidx/annotation/NonNull E> receiver )` Sorts elements in the `https://developer.android.com/reference/androidx/collection/MutableObjectList` of `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-comparable/index.html` elements in-place in ascending order. |
| `final void` | `<E extends https://developer.android.com/reference/java/lang/Comparable.html<@https://developer.android.com/reference/androidx/annotation/NonNull E>> https://developer.android.com/reference/androidx/collection/ObjectListKt.https://developer.android.com/reference/androidx/collection/MutableObjectList#(androidx.collection.MutableObjectList).sortDescending()( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/MutableObjectList<@https://developer.android.com/reference/androidx/annotation/NonNull E> receiver )` Sorts elements in the `https://developer.android.com/reference/androidx/collection/MutableObjectList` of `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-comparable/index.html` elements in-place in descending order. |

### Inherited methods

From [androidx.collection.ObjectList](https://developer.android.com/reference/androidx/collection/ObjectList) `final boolean` `https://developer.android.com/reference/androidx/collection/ObjectList#any()()`

Returns `true` if there's at least one element in the collection.
`final boolean` `https://developer.android.com/reference/androidx/collection/ObjectList#any(kotlin.Function1)(@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull element, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html> predicate)`

Returns `true` if any of the elements give a `true` return value for `https://developer.android.com/reference/androidx/collection/ObjectList#any(kotlin.Function1)`.
`final int` `https://developer.android.com/reference/androidx/collection/ObjectList#binarySearch(kotlin.Int,kotlin.Int,kotlin.Function1)(
@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int fromIndex,
@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int toIndex,
@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull element, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html> comparison
)`

Searches this `https://developer.android.com/reference/androidx/collection/ObjectList` or its range for an element for which the given `https://developer.android.com/reference/androidx/collection/ObjectList#binarySearch(kotlin.Int,kotlin.Int,kotlin.Function1)` function returns zero using binary search algorithm.
`final int` `https://developer.android.com/reference/androidx/collection/ObjectList#binarySearch(kotlin.Any,kotlin.Comparator,kotlin.Int,kotlin.Int)(
@https://developer.android.com/reference/androidx/annotation/NonNull E element,
@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-comparator/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull E> comparator,
@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int fromIndex,
@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int toIndex
)`

Searches this `https://developer.android.com/reference/androidx/collection/ObjectList` or its range for the provided `https://developer.android.com/reference/androidx/collection/ObjectList#binarySearch(kotlin.Any,kotlin.Comparator,kotlin.Int,kotlin.Int)` using the specified `https://developer.android.com/reference/androidx/collection/ObjectList#binarySearch(kotlin.Any,kotlin.Comparator,kotlin.Int,kotlin.Int)` across elements.
`final int` `<K extends https://developer.android.com/reference/java/lang/Comparable.html<@https://developer.android.com/reference/androidx/annotation/NonNull K>> https://developer.android.com/reference/androidx/collection/ObjectList#binarySearchBy(kotlin.Comparable,kotlin.Int,kotlin.Int,kotlin.Function1)(
K key,
@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int fromIndex,
@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int toIndex,
@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull element, K> selector
)`

Searches this `https://developer.android.com/reference/androidx/collection/ObjectList` or its range for an element having a key returned by `https://developer.android.com/reference/androidx/collection/ObjectList#binarySearchBy(kotlin.Comparable,kotlin.Int,kotlin.Int,kotlin.Function1)` equal to the specified `https://developer.android.com/reference/androidx/collection/ObjectList#binarySearchBy(kotlin.Comparable,kotlin.Int,kotlin.Int,kotlin.Function1)` using binary search algorithm.
`final boolean` `https://developer.android.com/reference/androidx/collection/ObjectList#contains(kotlin.Any)(@https://developer.android.com/reference/androidx/annotation/NonNull E element)`

Returns `true` if the `https://developer.android.com/reference/androidx/collection/ObjectList` contains `https://developer.android.com/reference/androidx/collection/ObjectList#contains(kotlin.Any)` or `false` otherwise.
`final boolean` `https://developer.android.com/reference/androidx/collection/ObjectList#containsAll(kotlin.Array)(@https://developer.android.com/reference/androidx/annotation/NonNull E[] elements)`

Returns `true` if the `https://developer.android.com/reference/androidx/collection/ObjectList` contains all elements in `https://developer.android.com/reference/androidx/collection/ObjectList#containsAll(kotlin.Array)` or `false` if one or more are missing.
`final boolean` `https://developer.android.com/reference/androidx/collection/ObjectList#containsAll(kotlin.collections.Iterable)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Iterable.html<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)`

Returns `true` if the `https://developer.android.com/reference/androidx/collection/ObjectList` contains all elements in `https://developer.android.com/reference/androidx/collection/ObjectList#containsAll(kotlin.collections.Iterable)` or `false` if one or more are missing.
`final boolean` `https://developer.android.com/reference/androidx/collection/ObjectList#containsAll(kotlin.collections.List)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)`

Returns `true` if the `https://developer.android.com/reference/androidx/collection/ObjectList` contains all elements in `https://developer.android.com/reference/androidx/collection/ObjectList#containsAll(kotlin.collections.List)` or `false` if one or more are missing.
`final boolean` `https://developer.android.com/reference/androidx/collection/ObjectList#containsAll(androidx.collection.ObjectList)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/ObjectList<@https://developer.android.com/reference/androidx/annotation/NonNull E> elements)`

Returns `true` if the `https://developer.android.com/reference/androidx/collection/ObjectList` contains all elements in `https://developer.android.com/reference/androidx/collection/ObjectList#containsAll(androidx.collection.ObjectList)` or `false` if one or more are missing.
`final int` `https://developer.android.com/reference/androidx/collection/ObjectList#count()()`

Returns the number of elements in this list.
`final int` `https://developer.android.com/reference/androidx/collection/ObjectList#count(kotlin.Function1)(@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull element, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html> predicate)`

Counts the number of elements matching `https://developer.android.com/reference/androidx/collection/ObjectList#count(kotlin.Function1)`.
`final @https://developer.android.com/reference/androidx/annotation/NonNull E` `https://developer.android.com/reference/androidx/collection/ObjectList#elementAt(kotlin.Int)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int index)`

Returns the element at the given `https://developer.android.com/reference/androidx/collection/ObjectList#elementAt(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-index-out-of-bounds-exception/index.html` if the `https://developer.android.com/reference/androidx/collection/ObjectList#elementAt(kotlin.Int)` is out of bounds of this collection.
`final @https://developer.android.com/reference/androidx/annotation/NonNull E` `https://developer.android.com/reference/androidx/collection/ObjectList#elementAtOrElse(kotlin.Int,kotlin.Function1)(
@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int index,
@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, @https://developer.android.com/reference/androidx/annotation/NonNull E> defaultValue
)`

Returns the element at the given `https://developer.android.com/reference/androidx/collection/ObjectList#elementAtOrElse(kotlin.Int,kotlin.Function1)` or `https://developer.android.com/reference/androidx/collection/ObjectList#elementAtOrElse(kotlin.Int,kotlin.Function1)` if `https://developer.android.com/reference/androidx/collection/ObjectList#elementAtOrElse(kotlin.Int,kotlin.Function1)` is out of bounds of the collection.
`boolean` `https://developer.android.com/reference/androidx/collection/ObjectList#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)`

Returns `true` if `https://developer.android.com/reference/androidx/collection/ObjectList#equals(kotlin.Any)` is a `https://developer.android.com/reference/androidx/collection/ObjectList` and the contents of this and `https://developer.android.com/reference/androidx/collection/ObjectList#equals(kotlin.Any)` are the same.
`final @https://developer.android.com/reference/androidx/annotation/NonNull E` `https://developer.android.com/reference/androidx/collection/ObjectList#first()()`

Returns the first element in the `https://developer.android.com/reference/androidx/collection/ObjectList` or throws a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-no-such-element-exception/index.html` if it `https://developer.android.com/reference/androidx/collection/ObjectList#isEmpty()`.
`final @https://developer.android.com/reference/androidx/annotation/NonNull E` `https://developer.android.com/reference/androidx/collection/ObjectList#first(kotlin.Function1)(@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull element, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html> predicate)`

Returns the first element in the `https://developer.android.com/reference/androidx/collection/ObjectList` for which `https://developer.android.com/reference/androidx/collection/ObjectList#first(kotlin.Function1)` returns `true` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-no-such-element-exception/index.html` if nothing matches.
`final E` `https://developer.android.com/reference/androidx/collection/ObjectList#firstOrNull()()`

Returns the first element in the `https://developer.android.com/reference/androidx/collection/ObjectList` or `null` if it `https://developer.android.com/reference/androidx/collection/ObjectList#isEmpty()`.
`final E` `https://developer.android.com/reference/androidx/collection/ObjectList#firstOrNull(kotlin.Function1)(
@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull element, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html> predicate
)`

Returns the first element in the `https://developer.android.com/reference/androidx/collection/ObjectList` for which `https://developer.android.com/reference/androidx/collection/ObjectList#firstOrNull(kotlin.Function1)` returns `true` or `null` if nothing matches.
`final @https://developer.android.com/reference/androidx/annotation/NonNull R` `<R extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/collection/ObjectList#fold(kotlin.Any,kotlin.Function2)(
@https://developer.android.com/reference/androidx/annotation/NonNull R initial,
@https://developer.android.com/reference/androidx/annotation/NonNull Function2<@https://developer.android.com/reference/androidx/annotation/NonNull acc, @https://developer.android.com/reference/androidx/annotation/NonNull element, @https://developer.android.com/reference/androidx/annotation/NonNull R> operation
)`

Accumulates values, starting with `https://developer.android.com/reference/androidx/collection/ObjectList#fold(kotlin.Any,kotlin.Function2)`, and applying `https://developer.android.com/reference/androidx/collection/ObjectList#fold(kotlin.Any,kotlin.Function2)` to each element in the `https://developer.android.com/reference/androidx/collection/ObjectList` in order.
`final @https://developer.android.com/reference/androidx/annotation/NonNull R` `<R extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/collection/ObjectList#foldIndexed(kotlin.Any,kotlin.Function3)(
@https://developer.android.com/reference/androidx/annotation/NonNull R initial,
@https://developer.android.com/reference/androidx/annotation/NonNull Function3<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, @https://developer.android.com/reference/androidx/annotation/NonNull acc, @https://developer.android.com/reference/androidx/annotation/NonNull element, @https://developer.android.com/reference/androidx/annotation/NonNull R> operation
)`

Accumulates values, starting with `https://developer.android.com/reference/androidx/collection/ObjectList#foldIndexed(kotlin.Any,kotlin.Function3)`, and applying `https://developer.android.com/reference/androidx/collection/ObjectList#foldIndexed(kotlin.Any,kotlin.Function3)` to each element in the `https://developer.android.com/reference/androidx/collection/ObjectList` in order.
`final @https://developer.android.com/reference/androidx/annotation/NonNull R` `<R extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/collection/ObjectList#foldRight(kotlin.Any,kotlin.Function2)(
@https://developer.android.com/reference/androidx/annotation/NonNull R initial,
@https://developer.android.com/reference/androidx/annotation/NonNull Function2<@https://developer.android.com/reference/androidx/annotation/NonNull element, @https://developer.android.com/reference/androidx/annotation/NonNull acc, @https://developer.android.com/reference/androidx/annotation/NonNull R> operation
)`

Accumulates values, starting with `https://developer.android.com/reference/androidx/collection/ObjectList#foldRight(kotlin.Any,kotlin.Function2)`, and applying `https://developer.android.com/reference/androidx/collection/ObjectList#foldRight(kotlin.Any,kotlin.Function2)` to each element in the `https://developer.android.com/reference/androidx/collection/ObjectList` in reverse order.
`final @https://developer.android.com/reference/androidx/annotation/NonNull R` `<R extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/collection/ObjectList#foldRightIndexed(kotlin.Any,kotlin.Function3)(
@https://developer.android.com/reference/androidx/annotation/NonNull R initial,
@https://developer.android.com/reference/androidx/annotation/NonNull Function3<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, @https://developer.android.com/reference/androidx/annotation/NonNull element, @https://developer.android.com/reference/androidx/annotation/NonNull acc, @https://developer.android.com/reference/androidx/annotation/NonNull R> operation
)`

Accumulates values, starting with `https://developer.android.com/reference/androidx/collection/ObjectList#foldRightIndexed(kotlin.Any,kotlin.Function3)`, and applying `https://developer.android.com/reference/androidx/collection/ObjectList#foldRightIndexed(kotlin.Any,kotlin.Function3)` to each element in the `https://developer.android.com/reference/androidx/collection/ObjectList` in reverse order.
`final void` `https://developer.android.com/reference/androidx/collection/ObjectList#forEach(kotlin.Function1)(@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull element, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> block)`

Calls `https://developer.android.com/reference/androidx/collection/ObjectList#forEach(kotlin.Function1)` for each element in the `https://developer.android.com/reference/androidx/collection/ObjectList`, in order.
`final void` `https://developer.android.com/reference/androidx/collection/ObjectList#forEachIndexed(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/Integer.html, @https://developer.android.com/reference/androidx/annotation/NonNull element, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> block
)`

Calls `https://developer.android.com/reference/androidx/collection/ObjectList#forEachIndexed(kotlin.Function2)` for each element in the `https://developer.android.com/reference/androidx/collection/ObjectList` along with its index, in order.
`final void` `https://developer.android.com/reference/androidx/collection/ObjectList#forEachReversed(kotlin.Function1)(@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull element, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> block)`

Calls `https://developer.android.com/reference/androidx/collection/ObjectList#forEachReversed(kotlin.Function1)` for each element in the `https://developer.android.com/reference/androidx/collection/ObjectList` in reverse order.
`final void` `https://developer.android.com/reference/androidx/collection/ObjectList#forEachReversedIndexed(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/Integer.html, @https://developer.android.com/reference/androidx/annotation/NonNull element, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> block
)`

Calls `https://developer.android.com/reference/androidx/collection/ObjectList#forEachReversedIndexed(kotlin.Function2)` for each element in the `https://developer.android.com/reference/androidx/collection/ObjectList` along with its index, in reverse order.
`final @https://developer.android.com/reference/androidx/annotation/NonNull E` `https://developer.android.com/reference/androidx/collection/ObjectList#get(kotlin.Int)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int index)`

Returns the element at the given `https://developer.android.com/reference/androidx/collection/ObjectList#get(kotlin.Int)` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-index-out-of-bounds-exception/index.html` if the `https://developer.android.com/reference/androidx/collection/ObjectList#get(kotlin.Int)` is out of bounds of this collection.
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.ranges/-int-range/index.html` `https://developer.android.com/reference/androidx/collection/ObjectList#getIndices()()`

Returns an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.ranges/-int-range/index.html` of the valid indices for this `https://developer.android.com/reference/androidx/collection/ObjectList`.
`final @https://developer.android.com/reference/androidx/annotation/IntRange(from = -1) int` `https://developer.android.com/reference/androidx/collection/ObjectList#getLastIndex()()`

Returns the last valid index in the `https://developer.android.com/reference/androidx/collection/ObjectList`.
`final @https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int` `https://developer.android.com/reference/androidx/collection/ObjectList#getSize()()`

The number of elements in the `https://developer.android.com/reference/androidx/collection/ObjectList`.
`int` `https://developer.android.com/reference/androidx/collection/ObjectList#hashCode()()`

Returns a hash code based on the contents of the `https://developer.android.com/reference/androidx/collection/ObjectList`.
`final int` `https://developer.android.com/reference/androidx/collection/ObjectList#indexOf(kotlin.Any)(@https://developer.android.com/reference/androidx/annotation/NonNull E element)`

Returns the index of `https://developer.android.com/reference/androidx/collection/ObjectList#indexOf(kotlin.Any)` in the `https://developer.android.com/reference/androidx/collection/ObjectList` or `-1` if `https://developer.android.com/reference/androidx/collection/ObjectList#indexOf(kotlin.Any)` is not there.
`final int` `https://developer.android.com/reference/androidx/collection/ObjectList#indexOfFirst(kotlin.Function1)(
@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull element, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html> predicate
)`

Returns the index if the first element in the `https://developer.android.com/reference/androidx/collection/ObjectList` for which `https://developer.android.com/reference/androidx/collection/ObjectList#indexOfFirst(kotlin.Function1)` returns `true` or -1 if there was no element for which predicate returned `true`.
`final int` `https://developer.android.com/reference/androidx/collection/ObjectList#indexOfLast(kotlin.Function1)(
@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull element, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html> predicate
)`

Returns the index if the last element in the `https://developer.android.com/reference/androidx/collection/ObjectList` for which `https://developer.android.com/reference/androidx/collection/ObjectList#indexOfLast(kotlin.Function1)` returns `true` or -1 if there was no element for which predicate returned `true`.
`final boolean` `https://developer.android.com/reference/androidx/collection/ObjectList#isEmpty()()`

Returns `true` if the `https://developer.android.com/reference/androidx/collection/ObjectList` has no elements in it or `false` otherwise.
`final boolean` `https://developer.android.com/reference/androidx/collection/ObjectList#isNotEmpty()()`

Returns `true` if there are elements in the `https://developer.android.com/reference/androidx/collection/ObjectList` or `false` if it is 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/ObjectList#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function1)(
@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,
Function1<@https://developer.android.com/reference/androidx/annotation/NonNull E, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html> transform
)`

Creates a String from the elements separated by `https://developer.android.com/reference/androidx/collection/ObjectList#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function1)` and using `https://developer.android.com/reference/androidx/collection/ObjectList#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function1)` before and `https://developer.android.com/reference/androidx/collection/ObjectList#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function1)` after, if supplied.
`final @https://developer.android.com/reference/androidx/annotation/NonNull E` `https://developer.android.com/reference/androidx/collection/ObjectList#last()()`

Returns the last element in the `https://developer.android.com/reference/androidx/collection/ObjectList` or throws a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-no-such-element-exception/index.html` if it `https://developer.android.com/reference/androidx/collection/ObjectList#isEmpty()`.
`final @https://developer.android.com/reference/androidx/annotation/NonNull E` `https://developer.android.com/reference/androidx/collection/ObjectList#last(kotlin.Function1)(@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull element, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html> predicate)`

Returns the last element in the `https://developer.android.com/reference/androidx/collection/ObjectList` for which `https://developer.android.com/reference/androidx/collection/ObjectList#last(kotlin.Function1)` returns `true` or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-no-such-element-exception/index.html` if nothing matches.
`final int` `https://developer.android.com/reference/androidx/collection/ObjectList#lastIndexOf(kotlin.Any)(@https://developer.android.com/reference/androidx/annotation/NonNull E element)`

Returns the index of the last element in the `https://developer.android.com/reference/androidx/collection/ObjectList` that is the same as `https://developer.android.com/reference/androidx/collection/ObjectList#lastIndexOf(kotlin.Any)` or `-1` if no elements match.
`final E` `https://developer.android.com/reference/androidx/collection/ObjectList#lastOrNull()()`

Returns the last element in the `https://developer.android.com/reference/androidx/collection/ObjectList` or `null` if it `https://developer.android.com/reference/androidx/collection/ObjectList#isEmpty()`.
`final E` `https://developer.android.com/reference/androidx/collection/ObjectList#lastOrNull(kotlin.Function1)(@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull element, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html> predicate)`

Returns the last element in the `https://developer.android.com/reference/androidx/collection/ObjectList` for which `https://developer.android.com/reference/androidx/collection/ObjectList#lastOrNull(kotlin.Function1)` returns `true` or `null` if nothing matches.
`final boolean` `https://developer.android.com/reference/androidx/collection/ObjectList#none()()`

Returns `true` if the collection has no elements in it.
`final boolean` `https://developer.android.com/reference/androidx/collection/ObjectList#reversedAny(kotlin.Function1)(
@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull element, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html> predicate
)`

Returns `true` if any of the elements give a `true` return value for `https://developer.android.com/reference/androidx/collection/ObjectList#reversedAny(kotlin.Function1)` while iterating in the reverse order.
`@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/collection/ObjectList#toString()()`

Returns a String representation of the list, surrounded by "\[\]" and each element separated by ", ".

## Public constructors

### MutableObjectList

```
public <E extends Object> MutableObjectList(int initialCapacity)
```

## Public methods

### add

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

```
public final boolean add(@NonNull E element)
```

Adds `https://developer.android.com/reference/androidx/collection/MutableObjectList#add(kotlin.Any)` to the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true`.

### add

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

```
public final void add(@IntRange(from = 0) int index, @NonNull E element)
```

Adds `https://developer.android.com/reference/androidx/collection/MutableObjectList#add(kotlin.Int,kotlin.Any)` to the `https://developer.android.com/reference/androidx/collection/MutableObjectList` at the given `https://developer.android.com/reference/androidx/collection/MutableObjectList#add(kotlin.Int,kotlin.Any)`, shifting over any elements at `https://developer.android.com/reference/androidx/collection/MutableObjectList#add(kotlin.Int,kotlin.Any)` and after, if any.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-index-out-of-bounds-exception/index.html` | if `https://developer.android.com/reference/androidx/collection/MutableObjectList#add(kotlin.Int,kotlin.Any)` isn't between 0 and `https://developer.android.com/reference/androidx/collection/ObjectList#size()`, inclusive |

### addAll

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

```
public final boolean addAll(@NonNull E[] elements)
```

Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Array)` to the end of the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true` if the `https://developer.android.com/reference/androidx/collection/MutableObjectList` was changed or `false` if `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Array)` was empty.

### addAll

```
public final boolean addAll(@NonNull Iterable<@NonNull E> elements)
```

Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.collections.Iterable)` to the end of the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true` if the `https://developer.android.com/reference/androidx/collection/MutableObjectList` was changed or `false` if `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.collections.Iterable)` was empty.

### addAll

```
public final boolean addAll(@NonNull List<@NonNull E> elements)
```

Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.collections.List)` to the end of the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true` if the `https://developer.android.com/reference/androidx/collection/MutableObjectList` was changed or `false` if `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.collections.List)` was empty.

### addAll

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

```
public final boolean addAll(@NonNull ObjectList<@NonNull E> elements)
```

Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(androidx.collection.ObjectList)` to the end of the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true` if the `https://developer.android.com/reference/androidx/collection/MutableObjectList` was changed or `false` if `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(androidx.collection.ObjectList)` was empty.

### addAll

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

```
public final boolean addAll(@NonNull ScatterSet<@NonNull E> elements)
```

Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(androidx.collection.ScatterSet)` to the end of the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true` if the `https://developer.android.com/reference/androidx/collection/MutableObjectList` was changed or `false` if `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(androidx.collection.ScatterSet)` was empty.

### addAll

```
public final boolean addAll(@NonNull Sequence<@NonNull E> elements)
```

Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.sequences.Sequence)` to the end of the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true` if the `https://developer.android.com/reference/androidx/collection/MutableObjectList` was changed or `false` if `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.sequences.Sequence)` was empty.

### addAll

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

```
public final boolean addAll(@IntRange(from = 0) int index, @NonNull E[] elements)
```

Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,kotlin.Array)` to the `https://developer.android.com/reference/androidx/collection/MutableObjectList` at the given `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,kotlin.Array)`, shifting over any elements at `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,kotlin.Array)` and after, if any.

| Returns |
|---|---|
| `boolean` | `true` if the `https://developer.android.com/reference/androidx/collection/MutableObjectList` was changed or `false` if `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,kotlin.Array)` was empty |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-index-out-of-bounds-exception/index.html` | if `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,kotlin.Array)` isn't between 0 and `https://developer.android.com/reference/androidx/collection/ObjectList#size()`, inclusive. |

### addAll

```
public final boolean addAll(@IntRange(from = 0) int index, @NonNull Collection<@NonNull E> elements)
```

Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,kotlin.collections.Collection)` to the `https://developer.android.com/reference/androidx/collection/MutableObjectList` at the given `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,kotlin.collections.Collection)`, shifting over any elements at `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,kotlin.collections.Collection)` and after, if any.

| Returns |
|---|---|
| `boolean` | `true` if the `https://developer.android.com/reference/androidx/collection/MutableObjectList` was changed or `false` if `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,kotlin.collections.Collection)` was empty |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-index-out-of-bounds-exception/index.html` | if `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,kotlin.collections.Collection)` isn't between 0 and `https://developer.android.com/reference/androidx/collection/ObjectList#size()`, inclusive. |

### addAll

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

```
public final boolean addAll(@IntRange(from = 0) int index, @NonNull ObjectList<@NonNull E> elements)
```

Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,androidx.collection.ObjectList)` to the `https://developer.android.com/reference/androidx/collection/MutableObjectList` at the given `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,androidx.collection.ObjectList)`, shifting over any elements at `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,androidx.collection.ObjectList)` and after, if any.

| Returns |
|---|---|
| `boolean` | `true` if the `https://developer.android.com/reference/androidx/collection/MutableObjectList` was changed or `false` if `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,androidx.collection.ObjectList)` was empty |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-index-out-of-bounds-exception/index.html` | if `https://developer.android.com/reference/androidx/collection/MutableObjectList#addAll(kotlin.Int,androidx.collection.ObjectList)` isn't between 0 and `https://developer.android.com/reference/androidx/collection/ObjectList#size()`, inclusive |

### asList

```
public @NonNull List<@NonNull E> asList()
```

Returns a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html` view into the `https://developer.android.com/reference/androidx/collection/ObjectList`. All access to the collection will be less efficient and abides by the allocation requirements of the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html`. For example, `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/index.html` will allocate an iterator. All access will go through the more expensive interface calls. Critical performance areas should use the `https://developer.android.com/reference/androidx/collection/ObjectList` API rather than `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html` API, when possible.

### asMutableList

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

```
public final @NonNull List<@NonNull E> asMutableList()
```

Returns a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html` view into the `https://developer.android.com/reference/androidx/collection/MutableObjectList`. All access to the collection will be less efficient and abides by the allocation requirements of the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html`. For example, `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/index.html` will allocate an iterator. All access will go through the more expensive interface calls. Critical performance areas should use the `https://developer.android.com/reference/androidx/collection/MutableObjectList` API rather than `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html` API, when possible.

### clear

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

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

Removes all elements in the `https://developer.android.com/reference/androidx/collection/MutableObjectList`. The storage isn't released.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/collection/MutableObjectList#trim(kotlin.Int)` |   |

### ensureCapacity

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

```
public final void ensureCapacity(int capacity)
```

Ensures that there is enough space to store `https://developer.android.com/reference/androidx/collection/MutableObjectList#ensureCapacity(kotlin.Int)` elements in the `https://developer.android.com/reference/androidx/collection/MutableObjectList`.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/collection/MutableObjectList#trim(kotlin.Int)` |   |

### getCapacity

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

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

Returns the total number of elements that can be held before the `https://developer.android.com/reference/androidx/collection/MutableObjectList` must grow.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/collection/MutableObjectList#ensureCapacity(kotlin.Int)` |   |

### minusAssign

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

```
public final void minusAssign(@NonNull E element)
```

`https://developer.android.com/reference/androidx/collection/MutableObjectList#minusAssign(kotlin.Any)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList`

### minusAssign

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

```
public final void minusAssign(@NonNull E[] elements)
```

Removes all `https://developer.android.com/reference/androidx/collection/MutableObjectList#minusAssign(kotlin.Array)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList`.

### minusAssign

```
public final void minusAssign(@NonNull Iterable<@NonNull E> elements)
```

Removes all `https://developer.android.com/reference/androidx/collection/MutableObjectList#minusAssign(kotlin.collections.Iterable)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList`.

### minusAssign

```
public final void minusAssign(@NonNull List<@NonNull E> elements)
```

Removes all `https://developer.android.com/reference/androidx/collection/MutableObjectList#minusAssign(kotlin.collections.List)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList`.

### minusAssign

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

```
public final void minusAssign(@NonNull ObjectList<@NonNull E> elements)
```

Removes all `https://developer.android.com/reference/androidx/collection/MutableObjectList#minusAssign(androidx.collection.ObjectList)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList`.

### minusAssign

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

```
public final void minusAssign(@NonNull ScatterSet<@NonNull E> elements)
```

Removes all `https://developer.android.com/reference/androidx/collection/MutableObjectList#minusAssign(androidx.collection.ScatterSet)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList`.

### minusAssign

```
public final void minusAssign(@NonNull Sequence<@NonNull E> elements)
```

Removes all `https://developer.android.com/reference/androidx/collection/MutableObjectList#minusAssign(kotlin.sequences.Sequence)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList`.

### plusAssign

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

```
public final void plusAssign(@NonNull E element)
```

`https://developer.android.com/reference/androidx/collection/MutableObjectList#plusAssign(kotlin.Any)` to the `https://developer.android.com/reference/androidx/collection/MutableObjectList`.

### plusAssign

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

```
public final void plusAssign(@NonNull E[] elements)
```

Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#plusAssign(kotlin.Array)` to the end of the `https://developer.android.com/reference/androidx/collection/MutableObjectList`.

### plusAssign

```
public final void plusAssign(@NonNull Iterable<@NonNull E> elements)
```

Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#plusAssign(kotlin.collections.Iterable)` to the end of the `https://developer.android.com/reference/androidx/collection/MutableObjectList`.

### plusAssign

```
public final void plusAssign(@NonNull List<@NonNull E> elements)
```

Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#plusAssign(kotlin.collections.List)` to the end of the `https://developer.android.com/reference/androidx/collection/MutableObjectList`.

### plusAssign

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

```
public final void plusAssign(@NonNull ObjectList<@NonNull E> elements)
```

Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#plusAssign(androidx.collection.ObjectList)` to the end of the `https://developer.android.com/reference/androidx/collection/MutableObjectList`.

### plusAssign

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

```
public final void plusAssign(@NonNull ScatterSet<@NonNull E> elements)
```

Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#plusAssign(androidx.collection.ScatterSet)` to the end of the `https://developer.android.com/reference/androidx/collection/MutableObjectList`.

### plusAssign

```
public final void plusAssign(@NonNull Sequence<@NonNull E> elements)
```

Adds all `https://developer.android.com/reference/androidx/collection/MutableObjectList#plusAssign(kotlin.sequences.Sequence)` to the end of the `https://developer.android.com/reference/androidx/collection/MutableObjectList`.

### remove

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

```
public final boolean remove(@NonNull E element)
```

Removes `https://developer.android.com/reference/androidx/collection/MutableObjectList#remove(kotlin.Any)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList`. If `https://developer.android.com/reference/androidx/collection/MutableObjectList#remove(kotlin.Any)` was in the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and was removed, `true` will be returned, or `false` will be returned if the element was not found.

### removeAll

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

```
public final boolean removeAll(@NonNull E[] elements)
```

Removes all `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeAll(kotlin.Array)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true` if anything was removed.

### removeAll

```
public final boolean removeAll(@NonNull Iterable<@NonNull E> elements)
```

Removes all `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeAll(kotlin.collections.Iterable)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true` if anything was removed.

### removeAll

```
public final boolean removeAll(@NonNull List<@NonNull E> elements)
```

Removes all `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeAll(kotlin.collections.List)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true` if anything was removed.

### removeAll

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

```
public final boolean removeAll(@NonNull ObjectList<@NonNull E> elements)
```

Removes all `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeAll(androidx.collection.ObjectList)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true` if anything was removed.

### removeAll

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

```
public final boolean removeAll(@NonNull ScatterSet<@NonNull E> elements)
```

Removes all `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeAll(androidx.collection.ScatterSet)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true` if anything was removed.

### removeAll

```
public final boolean removeAll(@NonNull Sequence<@NonNull E> elements)
```

Removes all `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeAll(kotlin.sequences.Sequence)` from the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and returns `true` if anything was removed.

### removeAt

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

```
public final @NonNull E removeAt(@IntRange(from = 0) int index)
```

Removes the element at the given `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeAt(kotlin.Int)` and returns it.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-index-out-of-bounds-exception/index.html` | if `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeAt(kotlin.Int)` isn't between 0 and `https://developer.android.com/reference/androidx/collection/ObjectList#lastIndex()`, inclusive |

### removeIf

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

```
public final void removeIf(@NonNull Function1<@NonNull element, @NonNull Boolean> predicate)
```

Removes all elements in this list for which `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeIf(kotlin.Function1)` returns `true`.

### removeRange

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

```
public final void removeRange(@IntRange(from = 0) int start, @IntRange(from = 0) int end)
```

Removes elements from index `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeRange(kotlin.Int,kotlin.Int)` (inclusive) to `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeRange(kotlin.Int,kotlin.Int)` (exclusive).

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-index-out-of-bounds-exception/index.html` | if `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeRange(kotlin.Int,kotlin.Int)` or `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeRange(kotlin.Int,kotlin.Int)` isn't between 0 and `https://developer.android.com/reference/androidx/collection/ObjectList#size()`, inclusive |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeRange(kotlin.Int,kotlin.Int)` is greater than `https://developer.android.com/reference/androidx/collection/MutableObjectList#removeRange(kotlin.Int,kotlin.Int)` |

### retainAll

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

```
public final boolean retainAll(@NonNull E[] elements)
```

Keeps only `https://developer.android.com/reference/androidx/collection/MutableObjectList#retainAll(kotlin.Array)` in the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and removes all other values.

| Returns |
|---|---|
| `boolean` | `true` if the `https://developer.android.com/reference/androidx/collection/MutableObjectList` has changed. |

### retainAll

```
public final boolean retainAll(@NonNull Collection<@NonNull E> elements)
```

Keeps only `https://developer.android.com/reference/androidx/collection/MutableObjectList#retainAll(kotlin.collections.Collection)` in the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and removes all other values.

| Returns |
|---|---|
| `boolean` | `true` if the `https://developer.android.com/reference/androidx/collection/MutableObjectList` has changed. |

### retainAll

```
public final boolean retainAll(@NonNull Iterable<@NonNull E> elements)
```

Keeps only `https://developer.android.com/reference/androidx/collection/MutableObjectList#retainAll(kotlin.collections.Iterable)` in the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and removes all other values.

| Returns |
|---|---|
| `boolean` | `true` if the `https://developer.android.com/reference/androidx/collection/MutableObjectList` has changed. |

### retainAll

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

```
public final boolean retainAll(@NonNull ObjectList<@NonNull E> elements)
```

Keeps only `https://developer.android.com/reference/androidx/collection/MutableObjectList#retainAll(androidx.collection.ObjectList)` in the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and removes all other values.

| Returns |
|---|---|
| `boolean` | `true` if the `https://developer.android.com/reference/androidx/collection/MutableObjectList` has changed. |

### retainAll

```
public final boolean retainAll(@NonNull Sequence<@NonNull E> elements)
```

Keeps only `https://developer.android.com/reference/androidx/collection/MutableObjectList#retainAll(kotlin.sequences.Sequence)` in the `https://developer.android.com/reference/androidx/collection/MutableObjectList` and removes all other values.

| Returns |
|---|---|
| `boolean` | `true` if the `https://developer.android.com/reference/androidx/collection/MutableObjectList` has changed. |

### set

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

```
public final @NonNull E set(@IntRange(from = 0) int index, @NonNull E element)
```

Sets the value at `https://developer.android.com/reference/androidx/collection/MutableObjectList#set(kotlin.Int,kotlin.Any)` to `https://developer.android.com/reference/androidx/collection/MutableObjectList#set(kotlin.Int,kotlin.Any)`.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull E` | the previous value set at `https://developer.android.com/reference/androidx/collection/MutableObjectList#set(kotlin.Int,kotlin.Any)` |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-index-out-of-bounds-exception/index.html` | if `https://developer.android.com/reference/androidx/collection/MutableObjectList#set(kotlin.Int,kotlin.Any)` isn't between 0 and `https://developer.android.com/reference/androidx/collection/ObjectList#lastIndex()`, inclusive |

### sortBy

```
public final void <R extends Comparable<@NonNull R>> sortBy(
    @NonNull Function1<@NonNull element, R> selector
)
```

Sorts elements in the `https://developer.android.com/reference/androidx/collection/MutableObjectList` in-place using values produced by `https://developer.android.com/reference/androidx/collection/MutableObjectList#sortBy(kotlin.Function1)` in ascending order.

### sortByDescending

```
public final void <R extends Comparable<@NonNull R>> sortByDescending(
    @NonNull Function1<@NonNull element, R> selector
)
```

Sorts elements in the `https://developer.android.com/reference/androidx/collection/MutableObjectList` in-place using values produced by `https://developer.android.com/reference/androidx/collection/MutableObjectList#sortByDescending(kotlin.Function1)` in descending order.

### sortWith

```
public final void sortWith(@NonNull Comparator<@NonNull E> comparator)
```

Sorts elements in the `https://developer.android.com/reference/androidx/collection/MutableObjectList` in-place using the specified `https://developer.android.com/reference/androidx/collection/MutableObjectList#sortWith(kotlin.Comparator)`.

### sortWith

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

```
public final void sortWith(
    @NonNull Function2<@NonNull a, @NonNull b, @NonNull Integer> comparison
)
```

Sorts elements in the `https://developer.android.com/reference/androidx/collection/MutableObjectList` in-place using the specified `https://developer.android.com/reference/androidx/collection/MutableObjectList#sortWith(kotlin.Function2)` function.

### trim

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

```
public final void trim(int minCapacity)
```

Reduces the internal storage. If `https://developer.android.com/reference/androidx/collection/MutableObjectList#capacity()` is greater than `https://developer.android.com/reference/androidx/collection/MutableObjectList#trim(kotlin.Int)` and `https://developer.android.com/reference/androidx/collection/ObjectList#size()`, the internal storage is reduced to the maximum of `https://developer.android.com/reference/androidx/collection/ObjectList#size()` and `https://developer.android.com/reference/androidx/collection/MutableObjectList#trim(kotlin.Int)`.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/collection/MutableObjectList#ensureCapacity(kotlin.Int)` |   |

## Extension functions

### ObjectListKt.sort

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

```
public final void <E extends Comparable<@NonNull E>> ObjectListKt.sort(
    @NonNull MutableObjectList<@NonNull E> receiver
)
```

Sorts elements in the `https://developer.android.com/reference/androidx/collection/MutableObjectList` of `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-comparable/index.html` elements in-place in ascending order.

### ObjectListKt.sortDescending

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

```
public final void <E extends Comparable<@NonNull E>> ObjectListKt.sortDescending(
    @NonNull MutableObjectList<@NonNull E> receiver
)
```

Sorts elements in the `https://developer.android.com/reference/androidx/collection/MutableObjectList` of `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-comparable/index.html` elements in-place in descending order.