SnapshotStateList

class SnapshotStateList<T> : MutableList<T> , StateObject

An implementation of MutableList that can be observed and snapshot. This is the result type created by androidx.compose.mutableStateListOf.

This class closely implements the same semantics as ArrayList.

See also

Constructors

SnapshotStateList
Link copied to clipboard
common
fun SnapshotStateList()

Types

StateListStateRecord
Link copied to clipboard
common
class StateListStateRecord<T> : StateRecord
This is an internal implementation class of SnapshotStateList.

Functions

add
Link copied to clipboard
common
open override fun add(element: T): Boolean
open override fun add(index: Int, element: T)
addAll
Link copied to clipboard
common
open override fun addAll(elements: Collection<T>): Boolean
open override fun addAll(index: Int, elements: Collection<T>): Boolean
clear
Link copied to clipboard
common
open override fun clear()
contains
Link copied to clipboard
common
open operator override fun contains(element: T): Boolean
containsAll
Link copied to clipboard
common
open override fun containsAll(elements: Collection<T>): Boolean
equals
Link copied to clipboard
common
open operator fun equals(other: Any?): Boolean
get
Link copied to clipboard
common
open operator override fun get(index: Int): T
hashCode
Link copied to clipboard
common
open fun hashCode(): Int
indexOf
Link copied to clipboard
common
open override fun indexOf(element: T): Int
isEmpty
Link copied to clipboard
common
open override fun isEmpty(): Boolean
iterator
Link copied to clipboard
common
open operator override fun iterator(): MutableIterator<T>
lastIndexOf
Link copied to clipboard
common
open override fun lastIndexOf(element: T): Int
listIterator
Link copied to clipboard
common
open override fun listIterator(): MutableListIterator<T>
open override fun listIterator(index: Int): MutableListIterator<T>
mergeRecords
Link copied to clipboard
common
open fun mergeRecords(previous: StateRecord, current: StateRecord, applied: StateRecord): StateRecord?
Produce a merged state based on the conflicting state changes.
prependStateRecord
Link copied to clipboard
common
open override fun prependStateRecord(value: StateRecord)
Add a new state record to the beginning of a list.
remove
Link copied to clipboard
common
open override fun remove(element: T): Boolean
removeAll
Link copied to clipboard
common
open override fun removeAll(elements: Collection<T>): Boolean
removeAt
Link copied to clipboard
common
open override fun removeAt(index: Int): T
removeRange
Link copied to clipboard
common
fun removeRange(fromIndex: Int, toIndex: Int)
retainAll
Link copied to clipboard
common
open override fun retainAll(elements: Collection<T>): Boolean
set
Link copied to clipboard
common
open operator override fun set(index: Int, element: T): T
subList
Link copied to clipboard
common
open override fun subList(fromIndex: Int, toIndex: Int): MutableList<T>
toString
Link copied to clipboard
common
open fun toString(): String

Properties

firstStateRecord
Link copied to clipboard
common
open override var firstStateRecord: SnapshotStateList.StateListStateRecord<T>
The first state record in a linked list of state records.
size
Link copied to clipboard
common
open override val size: Int