androidx.compose.runtime.collection

Classes

MutableVector

A MutableList-like structure with a simplified interface that offers faster access than ArrayList.

Cmn

Top-level functions summary

inline MutableVector
Any?> MutableVector(capacity: Int)

Create a MutableVector with a given initial capacity.

Cmn
inline MutableVector
Any?> MutableVector(size: Int, noinline init: (Int) -> T)

Create a MutableVector with a given size, initializing each element using the init function.

Cmn
inline MutableVector

Creates an empty MutableVector with a capacity of 16.

Cmn
inline MutableVector
Any?> mutableVectorOf(vararg elements: T)

Creates a MutableVector with the given values.

Cmn

Top-level functions

MutableVector

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

Create a MutableVector with a given initial capacity.

See also
ensureCapacity

MutableVector

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

Create a MutableVector with a given size, initializing each element using the init function.

init is called for each element in the MutableVector, starting from the first one and should return the value to be assigned to the element at its given index.

mutableVectorOf

inline fun Any?> mutableVectorOf(): MutableVector

Creates an empty MutableVector with a capacity of 16.

mutableVectorOf

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

Creates a MutableVector with the given values. This will use the passed vararg elements storage.