IAsyncViewableMap

interface IAsyncViewableMap<K : Any, V : Any> : IViewableMap<K, V> , IAsyncSource<IViewableMap.Event<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 adviseOn(    lifetime: Lifetime,     scheduler: IScheduler,     handler: (IViewableMap.Event<K, V>) -> Unit)

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

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 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
abstract val entries: Set<Map.Entry<K, V>>
Link copied to clipboard
abstract val keys: Set<K>
Link copied to clipboard
abstract val size: Int
Link copied to clipboard
abstract val values: Collection<V>