DotMap

@Serializable(with = DotMapSerializer::class)
class DotMap<K, S : DotStore<S>>(val entries: Map<K, S> = emptyMap()) : DotStore<DotMap<K, S>>

A DotStore mapping keys K to nested DotStores S. The causal join is applied per key, recursively, using the surrounding contexts; a key whose nested store becomes bottom (empty) is dropped. Causal<DotMap<E, DotSet>> is an OR-Set; a richer nested store gives an OR-Map.

Serialized by DotMapSerializer, which emits entries sorted by the structural encoding of their key (serialized primitive leaves, compared lexicographically) so that two replicas at the same logical state produce identical bytes regardless of delivery order (issue #713, hardened in #752).

Constructors

Link copied to clipboard
constructor(entries: Map<K, S> = emptyMap())

Properties

Link copied to clipboard
open override val dots: Set<Dot>

Every dot currently live in this store.

Link copied to clipboard
open override val empty: DotMap<K, S>

The empty (bottom) store of this shape — no dots.

Link copied to clipboard
val entries: Map<K, S>
Link copied to clipboard
open val isBottom: Boolean

True when the store holds no dots.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun join(other: DotMap<K, S>, context: DotContext, otherContext: DotContext): DotMap<K, S>

The causal join with other. A dot is kept when it is live in both stores, or live in one and not yet witnessed by the other side's context; it is dropped only when one side still has it while the other has it in otherContext but not in its store — the signature of a deliberate remove. context is this store's surrounding causal history; otherContext is the other's.

Link copied to clipboard
open override fun toString(): String