androidx.compose.runtime.collection
Classes
MutableVector |
A MutableList-like structure with a simplified interface that offers faster access than ArrayList. |
Top-level functions summary
MutableVector<T> |
MutableVector(capacity: Int = 16) Create a MutableVector with a given initial capacity. |
MutableVector<T> |
MutableVector(size: Int, noinline init: (Int) -> T) Create a MutableVector with a given size, initialiing each element using the init function. |
MutableVector<T> |
Creates an empty MutableVector with a capacity of 16. |
MutableVector<T> |
mutableVectorOf(vararg elements: T) Creates a MutableVector with the given values. |
Top-level functions
MutableVector
inline fun <reified T> MutableVector(capacity: Int = 16): MutableVector<T>
Create a MutableVector with a given initial capacity.
See Also
MutableVector
inline fun <reified T> MutableVector(
size: Int,
noinline init: (Int) -> T
): MutableVector<T>
Create a MutableVector with a given size, initialiing 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 <reified T> mutableVectorOf(): MutableVector<T>
Creates an empty MutableVector with a capacity of 16.
mutableVectorOf
inline fun <reified T> mutableVectorOf(vararg elements: T): MutableVector<T>
Creates a MutableVector with the given values. This will use the passed vararg elements storage.