MutableMirrorableMap

class MutableMirrorableMap<K, V>(backingMap: MutableMap<K, V>) : MirrorableMap<K, V> , MutableMap<K, V> , Map<K, V>

Implements a mutable MirrorableMap.

Wraps the backingMap which can be any type of MutableMap. After constructing a MutableMirrorableMap, changes to the backingMap need to be made through the MutableMirrorableMap instance.

Throws

when the map is modified in an unsupported manner through the entries, keys or values properties. This behavior is the same for MutableMap types.

Constructors

Link copied to clipboard
fun MutableMirrorableMap()

Constructs a MutableMirrorableMap with an empty MutableMap as backingMap.

Link copied to clipboard
fun <K, V> MutableMirrorableMap(vararg pairs: Pair<K, V>)

Constructs a MutableMirrorableMap with an MutableMap as backingMap with the specified contents, given as a list of pairs.

Link copied to clipboard
fun <K, V> MutableMirrorableMap(backingMap: MutableMap<K, V>)

Constructs a MutableMirrorableMap with any MutableMap instance as backingMap.

Properties

Link copied to clipboard
open override val entries: MutableSet<MutableMap.MutableEntry<K, V>>
Link copied to clipboard
open override val keys: MutableSet<K>
Link copied to clipboard
open override val listeners: LifecycleAwareListenersOwner<MirrorableMapListener<K, V>>

Listeners of the MirrorableMap. On any map change, all listeners will receive a callback.

Link copied to clipboard
open override val values: MutableCollection<V>

Inherited properties

Link copied to clipboard
open override val size: Int

Functions

Link copied to clipboard
fun asMirrorableMap(): MirrorableMap<K, V>

Cast this to a non-mutable MirrorableMap.

Link copied to clipboard
open override fun clear()
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun put(key: K, value: V): V?
Link copied to clipboard
fun putAll(from: Iterable<Pair<K, V>>)

Put all the items from an Iterable into the map.

open override fun putAll(from: Map<out K, V>)
Link copied to clipboard
open override fun remove(key: K): V?
Link copied to clipboard
fun removeAll(condition: (K) -> Boolean)

Remove all the keys in a map matching the condition.

Inherited functions

Link copied to clipboard
open fun compute(p0: K, p1: BiFunction<in K, in V?, out V?>): V?
Link copied to clipboard
open fun computeIfAbsent(p0: K, p1: Function<in K, out V>): V
Link copied to clipboard
open fun computeIfPresent(p0: K, p1: BiFunction<in K, in V, out V?>): V?
Link copied to clipboard
open override fun containsKey(key: K): Boolean
Link copied to clipboard
open override fun containsValue(value: V): Boolean
Link copied to clipboard
open fun forEach(p0: BiConsumer<in K, in V>)
Link copied to clipboard
open operator override fun get(key: K): V?
Link copied to clipboard
open fun getOrDefault(key: K, defaultValue: V): V
Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard
open fun merge(    p0: K,     p1: V,     p2: BiFunction<in V, in V, out V?>): V?
Link copied to clipboard
open fun putIfAbsent(p0: K, p1: V): V?
Link copied to clipboard
open fun remove(key: K, value: V): Boolean
Link copied to clipboard
open fun replace(p0: K, p1: V): V?
open fun replace(    p0: K,     p1: V,     p2: V): Boolean
Link copied to clipboard
open fun replaceAll(p0: BiFunction<in K, in V, out V>)