ObservableMap¶
class ObservableMap<K, V>(map: MutableMap<K, V>, listener: (MutableMap<K, V>) -> Unit) : MutableMap<K, V>
A MutableMap wrapper that invokes listener with the underlying map after every mutating operation. Used by mapField-style NBTHolder delegates to detect changes and persist/sync them.
Constructors¶
ObservableMap¶
constructor(map: MutableMap<K, V>, listener: (MutableMap<K, V>) -> Unit)
Properties¶
entries¶
open override val entries: MutableSet<MutableMap.MutableEntry<K, V>>
keys¶
open override val keys: MutableSet<K>
size¶
values¶
open override val values: MutableCollection<V>
Functions¶
clear¶
open override fun clear()
compute¶
computeIfAbsent¶
computeIfPresent¶
open override fun computeIfPresent(key: K, remappingFunction: BiFunction<in K, in V & Any, out V?>): V?
containsKey¶
open override fun containsKey(key: K): Boolean
containsValue¶
open override fun containsValue(value: V): Boolean
get¶
isEmpty¶
merge¶
put¶
putAll¶
putIfAbsent¶
open override fun putIfAbsent(key: K, value: V): V?
remove¶
replace¶
replaceAll¶
open override fun replaceAll(function: BiFunction<in K, in V, out V>)