O Google tem o compromisso de promover a igualdade racial para as comunidades negras. Saiba como.

MutableVector

class MutableVector<T> : RandomAccess
kotlin.Any
   ↳ androidx.compose.runtime.collection.MutableVector

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

Summary

Public methods
Boolean
add(element: T)

Adds element to the MutableVector and returns true.

Unit
add(index: Int, element: T)

Adds element to the MutableVector at the given index, shifting over any elements that are in the way.

Boolean
addAll(index: Int, elements: List<T>)

Adds all elements to the MutableVector at the given index, shifting over any elements that are in the way.

Boolean
addAll(index: Int, elements: MutableVector<T>)

Adds all elements to the MutableVector at the given index, shifting over any elements that are in the way.

Boolean
addAll(elements: List<T>)

Adds all elements to the end of the MutableVector and returns true if the MutableVector was changed.

Boolean
addAll(elements: MutableVector<T>)

Adds all elements to the end of the MutableVector and returns true if the MutableVector was changed.

Boolean
addAll(elements: Array<T>)

Adds all elements to the end of the MutableVector and returns true if the MutableVector was changed.

Boolean
addAll(index: Int, elements: Collection<T>)

Adds all elements to the MutableVector at the given index, shifting over any elements that are in the way.

Boolean
addAll(elements: Collection<T>)

Adds all elements to the end of the MutableVector and returns true if the MutableVector was changed.

Boolean
any(predicate: (T) -> Boolean)

Returns true if any of the elements give a true return value for predicate.

MutableList<T>

Returns MutableList interface access to the MutableVector.

Unit

Removes all elements in the MutableVector.

operator Boolean
contains(element: T)

Returns true if the MutableVector contains element or false otherwise.

Boolean
containsAll(elements: List<T>)

Returns true if the MutableVector contains all elements in elements or false if one or more are missing.

Boolean
containsAll(elements: Collection<T>)

Returns true if the MutableVector contains all elements in elements or false if one or more are missing.

Boolean
containsAll(elements: MutableVector<T>)

Returns true if the MutableVector contains all elements in elements or false if one or more are missing.

Boolean

Returns true if the contents of the MutableVector are the same or false if there is any difference.

Unit
ensureCapacity(capacity: Int)

Ensures that there is enough space to store capacity elements in the MutableVector.

T

Returns the first element in the MutableVector or throws a NoSuchElementException if it isEmpty.

T
first(predicate: (T) -> Boolean)

Returns the first element in the MutableVector for which predicate returns true or throws