# androidx.compose.runtime.collection

Common/All

## Classes

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/MutableVector` | A `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html`-like structure with a simplified interface that offers faster access than `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-array-list/index.html`. | Cmn |

## Top-level functions summary

|---|---|---|
| `inline https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/MutableVector<T>` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/package-summary#MutableVector(kotlin.Int)(capacity: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Create a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/package-summary#MutableVector(kotlin.Int)` with a given initial `https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/package-summary#MutableVector(kotlin.Int)`. | Cmn |
| `inline https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/MutableVector<T>` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/package-summary#MutableVector(kotlin.Int,kotlin.Function1)(size: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, noinline init: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) -> T)` Create a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/package-summary#MutableVector(kotlin.Int,kotlin.Function1)` with a given `https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/package-summary#MutableVector(kotlin.Int,kotlin.Function1)`, initializing each element using the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/package-summary#MutableVector(kotlin.Int,kotlin.Function1)` function. | Cmn |
| `inline https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/MutableVector<T>` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/package-summary#mutableVectorOf()()` Creates an empty `https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/MutableVector` with a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/MutableVector#ensureCapacity(kotlin.Int)` of 16. | Cmn |
| `inline https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/MutableVector<T>` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/package-summary#mutableVectorOf(kotlin.Array)(vararg elements: T)` Creates a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/MutableVector` with the given values. | Cmn |

## Top-level functions

### MutableVector

Cmn Artifact: [androidx.compose.runtime:runtime](https://developer.android.com/jetpack/androidx/releases/compose-runtime) [View Source](https://cs.android.com/search?q=file:androidx/compose/runtime/collection/MutableVector.kt+function:MutableVector)

```
inline fun <T : Any?> MutableVector(capacity: Int = 16): MutableVector<T>
```

Create a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/package-summary#MutableVector(kotlin.Int)` with a given initial `https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/package-summary#MutableVector(kotlin.Int)`.

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

### MutableVector

Cmn Artifact: [androidx.compose.runtime:runtime](https://developer.android.com/jetpack/androidx/releases/compose-runtime) [View Source](https://cs.android.com/search?q=file:androidx/compose/runtime/collection/MutableVector.kt+function:MutableVector)

```
inline fun <T : Any?> MutableVector(size: Int, noinline init: (Int) -> T): MutableVector<T>
```

Create a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/package-summary#MutableVector(kotlin.Int,kotlin.Function1)` with a given `https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/package-summary#MutableVector(kotlin.Int,kotlin.Function1)`, initializing each element using the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/package-summary#MutableVector(kotlin.Int,kotlin.Function1)` function.

`https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/package-summary#MutableVector(kotlin.Int,kotlin.Function1)` is called for each element in the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/package-summary#MutableVector(kotlin.Int,kotlin.Function1)`, starting from the first one and should return the value to be assigned to the element at its given index.

### mutableVectorOf

Cmn Artifact: [androidx.compose.runtime:runtime](https://developer.android.com/jetpack/androidx/releases/compose-runtime) [View Source](https://cs.android.com/search?q=file:androidx/compose/runtime/collection/MutableVector.kt+function:mutableVectorOf)

```
inline fun <T : Any?> mutableVectorOf(): MutableVector<T>
```

Creates an empty `https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/MutableVector` with a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/MutableVector#ensureCapacity(kotlin.Int)` of 16.

### mutableVectorOf

Cmn Artifact: [androidx.compose.runtime:runtime](https://developer.android.com/jetpack/androidx/releases/compose-runtime) [View Source](https://cs.android.com/search?q=file:androidx/compose/runtime/collection/MutableVector.kt+function:mutableVectorOf)

```
inline fun <T : Any?> mutableVectorOf(vararg elements: T): MutableVector<T>
```

Creates a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/MutableVector` with the given values. This will use the passed vararg `https://developer.android.com/reference/kotlin/androidx/compose/runtime/collection/package-summary#mutableVectorOf(kotlin.Array)` storage.