IPerContextMap

interface IPerContextMap<K : Any, out V : Any> : IViewableMap<K, V> , IRdDynamic

A collection that automatically maps values to keys from RdContext's value set Key-value pairs in this map are automatically managed based on possible values of RdContext

As context value sets are protocol-specific, this map will behave differently depending on whether or not it's bound to a com.jetbrains.rd.framework.IProtocol An unbound map will automatically create mappings for all context values it's accessed with. When a map is bound later, all values not present in protocol value set will be silently dropped.

See also

Inheritors

Properties

Link copied to clipboard
abstract val change: ISource<IViewableMap.Event<K, V>>
Link copied to clipboard
abstract val context: RdContext<K>

The context that is used by this map. Must be heavy.

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 location: RName
Link copied to clipboard
abstract val protocol: IProtocol?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract val size: Int
Link copied to clipboard
abstract val values: Collection<V>

Functions

Link copied to clipboard
abstract fun advise(lifetime: Lifetime, handler: (IViewableMap.Event<K, V>) -> Unit)
Link copied to clipboard
open fun adviseAddRemove(lifetime: Lifetime, handler: (AddRemove, K, V) -> Unit)
Link copied to clipboard
fun <T> ISource<T>.adviseSuspend(lifetime: Lifetime, scheduler: IScheduler, handler: suspend (T) -> Unit)
fun <T> ISource<T>.adviseSuspend(lifetime: Lifetime, context: CoroutineContext, handler: suspend (T) -> Unit)
Link copied to clipboard
abstract fun containsKey(key: K): Boolean
Link copied to clipboard
abstract fun containsValue(value: V): Boolean
Link copied to clipboard
abstract operator override fun get(key: K): V?

Gets the value associated with specified context value, or null if none is associated When this map is not bound, this will automatically create a new mapping instead of returning null

Link copied to clipboard
abstract fun getForCurrentContext(): V

Gets the value associated with current context value, equivalent to get(context.value) If the context doesn't have a value set, or contexts's protocol value set does not contain the current context value, this will throw an exception

Link copied to clipboard
abstract fun isEmpty(): Boolean
Link copied to clipboard
suspend fun ISource<Boolean>.nextFalseValue(lifetime: Lifetime = Lifetime.Eternal): Boolean
Link copied to clipboard
fun ISource<Boolean>.nextFalseValueAsync(lifetime: Lifetime): Deferred<Boolean>
Link copied to clipboard
suspend fun <T : Any> ISource<T?>.nextNotNullValue(lifetime: Lifetime = Lifetime.Eternal): T
Link copied to clipboard
fun <T : Any> ISource<T?>.nextNotNullValueAsync(lifetime: Lifetime): Deferred<T>
Link copied to clipboard
suspend fun ISource<Boolean>.nextTrueValue(lifetime: Lifetime = Lifetime.Eternal): Boolean
Link copied to clipboard
fun ISource<Boolean>.nextTrueValueAsync(lifetime: Lifetime): Deferred<Boolean>
Link copied to clipboard
suspend fun <T> ISource<T>.nextValue(lifetime: Lifetime = Lifetime.Eternal, condition: (T) -> Boolean = { true }): T
Link copied to clipboard
fun <T> ISource<T>.nextValueAsync(lifetime: Lifetime, condition: (T) -> Boolean = { true }): Deferred<T>
Link copied to clipboard
open override fun view(lifetime: Lifetime, handler: (Lifetime, Map.Entry<K, V>) -> Unit)
open fun view(lifetime: Lifetime, handler: (Lifetime, K, V) -> Unit)