SnapshotStateMap
Kotlin
|Java
@Stable class SnapshotStateMap<K, V> : MutableMap<K, V>, StateObject
kotlin.Any | |
↳ | androidx.compose.runtime.snapshots.SnapshotStateMap |
An implementation of MutableMap that can be observed and snapshot. This is the result type created by androidx.compose.runtime.mutableStateMapOf.
This class closely implements the same semantics as HashMap.
Summary
Public constructors | |
---|---|
<init>() An implementation of MutableMap that can be observed and snapshot. |
Public methods | |
---|---|
Unit |
clear() |
Boolean |
containsKey(key: K) |
Boolean |
containsValue(value: V) |
V? |
get(key: K) |
Boolean |
isEmpty() |
Unit |
prependStateRecord(value: StateRecord) Add a new state record to the beginning of a list. |
V? |
put(key: K, value: V) |
Unit | |
V? |
remove(key: K) |
Inherited functions | |
---|---|
Properties | |
---|---|
MutableSet<MutableEntry<K, V>> | |
StateRecord |
The first state record in a linked list of state records. |
MutableSet<K> | |
Int | |
MutableCollection<V> |
Public constructors
<init>
SnapshotStateMap()
An implementation of MutableMap that can be observed and snapshot. This is the result type created by androidx.compose.runtime.mutableStateMapOf.
This class closely implements the same semantics as HashMap.
Public methods
clear
fun clear(): Unit
containsKey
fun containsKey(key: K): Boolean
containsValue
fun containsValue(value: V): Boolean
get
fun get(key: K): V?
isEmpty
fun isEmpty(): Boolean
prependStateRecord
fun prependStateRecord(value: StateRecord): Unit
Add a new state record to the beginning of a list. After this call firstStateRecord should be value.
put
fun put(
key: K,
value: V
): V?
putAll
fun putAll(from: Map<out K, V>):