IMutableViewableMap

interface IMutableViewableMap<K : Any, V : Any> : MutableMap<K, V> , IViewableMap<K, V>

Functions

Link copied to clipboard
abstract fun advise(lifetime: Lifetime, handler: (IViewableMap.Event<K, V>) -> Unit)

Adds an event subscription. Every time an event occurs, the handler is called, receiving an instance of the event. The subscription is removed when the given lifetime expires.

Link copied to clipboard
open fun adviseAddRemove(lifetime: Lifetime, handler: (AddRemove, K, V) -> Unit)

Adds a subscription to additions and removals of map elements. When a map element is updated, the handler is called twice: to report the removal of the old element and the addition of the new one.

Link copied to clipboard
abstract fun clear()
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
abstract fun containsKey(key: K): Boolean
Link copied to clipboard
abstract fun containsValue(value: V): Boolean
Link copied to clipboard
open fun forEach(p0: BiConsumer<in K, in V>)
Link copied to clipboard
abstract operator fun get(key: K): V?
Link copied to clipboard
open fun getOrDefault(key: K, defaultValue: V): V
Link copied to clipboard
abstract 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
abstract fun put(key: K, value: V): V?
Link copied to clipboard
abstract fun putAll(from: Map<out K, V>)
Link copied to clipboard
open fun putIfAbsent(p0: K, p1: V): V?
Link copied to clipboard
abstract fun remove(key: K): V?
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>)
Link copied to clipboard
open override fun view(lifetime: Lifetime, handler: (Lifetime, Map.Entry<K, V>) -> Unit)

Adds a subscription to changes of the contents of the map.

open fun view(lifetime: Lifetime, handler: (Lifetime, K, V) -> Unit)

Adds a subscription to changes of the contents of the map, with the handler receiving keys and values as separate parameters.

Properties

Link copied to clipboard
abstract val change: ISource<IViewableMap.Event<K, V>>
Link copied to clipboard
open val changing: Boolean
Link copied to clipboard
abstract override val entries: MutableSet<MutableMap.MutableEntry<K, V>>
Link copied to clipboard
abstract override val keys: MutableSet<K>
Link copied to clipboard
abstract val size: Int
Link copied to clipboard
abstract override val values: MutableCollection<V>

Inheritors

Link copied to clipboard

Extensions

Link copied to clipboard
fun <K : Any, V : Any, T : Any> IMutableViewableMap<K, V>.toViewableList(lifetime: Lifetime, converter: (Lifetime, V) -> T): ViewableList<T>

Converts a viewable map to a viewable list of values, where the converter function is used to convert each map value to a list value.