ViewableMap

class ViewableMap<K : Any, V : Any>(map: MutableMap<K, V> = LinkedHashMap()) : IMutableViewableMap<K, V>

Constructors

Link copied to clipboard
fun <K : Any, V : Any> ViewableMap(map: MutableMap<K, V> = LinkedHashMap())

Functions

Link copied to clipboard
open override 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
open override 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
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 override fun put(key: K, value: V): V?
Link copied to clipboard
open override fun putAll(from: Map<out K, V>)
Link copied to clipboard
open fun putIfAbsent(p0: K, p1: V): V?
Link copied to clipboard
open override fun remove(key: K): V?
open override 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
open override val change: Signal<IViewableMap.Event<K, V>>
Link copied to clipboard
open val changing: Boolean
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 size: Int
Link copied to clipboard
open override val values: MutableCollection<V>