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

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
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 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
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)
open fun view(lifetime: Lifetime, handler: (Lifetime, K, V) -> Unit)

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
abstract val serializationContext: SerializationCtx?
Link copied to clipboard
abstract val size: Int
Link copied to clipboard
abstract val values: Collection<V>

Inheritors

Link copied to clipboard