Class ORMultiValueDictionary<TKey, TValue>
An immutable multi-map implementation. This class wraps an
ORDictionary<TKey, TValue> with an ORSet<T> for the map's value.
This class is immutable, i.e. "modifying" methods return a new instance.
Inheritance
ORMultiValueDictionary<TKey, TValue>
Assembly: Akka.DistributedData.dll
Syntax
[Serializable]
public sealed class ORMultiValueDictionary<TKey, TValue> : IDeltaReplicatedData<ORMultiValueDictionary<TKey, TValue>, ORDictionary<TKey, ORSet<TValue>>.IDeltaOperation>, IDeltaReplicatedData, IRemovedNodePruning<ORMultiValueDictionary<TKey, TValue>>, IRemovedNodePruning, IReplicatedData<ORMultiValueDictionary<TKey, TValue>>, IReplicatedData, IReplicatedDataSerialization, IEquatable<ORMultiValueDictionary<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, IImmutableSet<TValue>>>, IEnumerable
Type Parameters
Name |
Description |
TKey |
|
TValue |
|
Fields
|
Improve this Doc
View Source
Empty
Declaration
public static readonly ORMultiValueDictionary<TKey, TValue> Empty
Field Value
|
Improve this Doc
View Source
EmptyWithValueDeltas
Declaration
public static readonly ORMultiValueDictionary<TKey, TValue> EmptyWithValueDeltas
Field Value
Properties
|
Improve this Doc
View Source
Count
Declaration
public int Count { get; }
Property Value
|
Improve this Doc
View Source
Delta
Declaration
public ORDictionary<TKey, ORSet<TValue>>.IDeltaOperation Delta { get; }
Property Value
|
Improve this Doc
View Source
DeltaValues
Declaration
public bool DeltaValues { get; }
Property Value
|
Improve this Doc
View Source
Entries
Declaration
public IImmutableDictionary<TKey, IImmutableSet<TValue>> Entries { get; }
Property Value
Type |
Description |
System.Collections.Immutable.IImmutableDictionary<TKey, System.Collections.Immutable.IImmutableSet<TValue>> |
|
|
Improve this Doc
View Source
IsEmpty
Declaration
public bool IsEmpty { get; }
Property Value
|
Improve this Doc
View Source
Item[TKey]
Declaration
public IImmutableSet<TValue> this[TKey key] { get; }
Parameters
Type |
Name |
Description |
TKey |
key |
|
Property Value
Type |
Description |
System.Collections.Immutable.IImmutableSet<TValue> |
|
|
Improve this Doc
View Source
Keys
Returns all keys stored within current ORMultiDictionary.
Declaration
public IEnumerable<TKey> Keys { get; }
Property Value
|
Improve this Doc
View Source
KeyType
Declaration
public Type KeyType { get; }
Property Value
|
Improve this Doc
View Source
ModifiedByNodes
Declaration
public ImmutableHashSet<UniqueAddress> ModifiedByNodes { get; }
Property Value
Type |
Description |
System.Collections.Immutable.ImmutableHashSet<UniqueAddress> |
|
|
Improve this Doc
View Source
Values
Returns all values stored in all buckets within current ORMultiDictionary.
Declaration
public IEnumerable<TValue> Values { get; }
Property Value
|
Improve this Doc
View Source
ValueType
Declaration
public Type ValueType { get; }
Property Value
Methods
|
Improve this Doc
View Source
AddItem(Cluster, TKey, TValue)
Add an element to a set associated with a key. If there is no existing set then one will be initialised.
Declaration
public ORMultiValueDictionary<TKey, TValue> AddItem(Cluster node, TKey key, TValue element)
Parameters
Type |
Name |
Description |
Cluster |
node |
|
TKey |
key |
|
TValue |
element |
|
Returns
|
Improve this Doc
View Source
AddItem(UniqueAddress, TKey, TValue)
Add an element to a set associated with a key. If there is no existing set then one will be initialised.
Declaration
public ORMultiValueDictionary<TKey, TValue> AddItem(UniqueAddress node, TKey key, TValue element)
Parameters
Returns
|
Improve this Doc
View Source
ContainsKey(TKey)
Declaration
public bool ContainsKey(TKey key)
Parameters
Type |
Name |
Description |
TKey |
key |
|
Returns
|
Improve this Doc
View Source
Equals(ORMultiValueDictionary<TKey, TValue>)
Declaration
public bool Equals(ORMultiValueDictionary<TKey, TValue> other)
Parameters
Returns
|
Improve this Doc
View Source
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
Object |
obj |
|
Returns
Overrides
|
Improve this Doc
View Source
GetEnumerator()
Declaration
public IEnumerator<KeyValuePair<TKey, IImmutableSet<TValue>>> GetEnumerator()
Returns
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
|
Improve this Doc
View Source
Merge(IReplicatedData)
Declaration
public IReplicatedData Merge(IReplicatedData other)
Parameters
Returns
|
Improve this Doc
View Source
Merge(ORMultiValueDictionary<TKey, TValue>)
Declaration
public ORMultiValueDictionary<TKey, TValue> Merge(ORMultiValueDictionary<TKey, TValue> other)
Parameters
Returns
|
Improve this Doc
View Source
MergeDelta(ORDictionary<TKey, ORSet<TValue>>.IDeltaOperation)
Declaration
public ORMultiValueDictionary<TKey, TValue> MergeDelta(ORDictionary<TKey, ORSet<TValue>>.IDeltaOperation delta)
Parameters
Returns
|
Improve this Doc
View Source
NeedPruningFrom(UniqueAddress)
Declaration
public bool NeedPruningFrom(UniqueAddress removedNode)
Parameters
Returns
|
Improve this Doc
View Source
Prune(UniqueAddress, UniqueAddress)
Declaration
public ORMultiValueDictionary<TKey, TValue> Prune(UniqueAddress removedNode, UniqueAddress collapseInto)
Parameters
Returns
|
Improve this Doc
View Source
PruningCleanup(UniqueAddress)
Declaration
public ORMultiValueDictionary<TKey, TValue> PruningCleanup(UniqueAddress removedNode)
Parameters
Returns
|
Improve this Doc
View Source
Remove(Cluster, TKey)
Removes all values inside current dictionary stored under provided key
in the context of the provided cluster node
.
Declaration
public ORMultiValueDictionary<TKey, TValue> Remove(Cluster node, TKey key)
Parameters
Type |
Name |
Description |
Cluster |
node |
|
TKey |
key |
|
Returns
|
Improve this Doc
View Source
Remove(UniqueAddress, TKey)
Removes all values inside current dictionary stored under provided key
in the context of the provided cluster node
.
Declaration
public ORMultiValueDictionary<TKey, TValue> Remove(UniqueAddress node, TKey key)
Parameters
Returns
|
Improve this Doc
View Source
RemoveItem(Cluster, TKey, TValue)
Remove an element of a set associated with a key. If there are no more elements in the set then the
entire set will be removed.
Declaration
public ORMultiValueDictionary<TKey, TValue> RemoveItem(Cluster node, TKey key, TValue element)
Parameters
Type |
Name |
Description |
Cluster |
node |
|
TKey |
key |
|
TValue |
element |
|
Returns
|
Improve this Doc
View Source
RemoveItem(UniqueAddress, TKey, TValue)
Remove an element of a set associated with a key. If there are no more elements in the set then the
entire set will be removed.
Declaration
public ORMultiValueDictionary<TKey, TValue> RemoveItem(UniqueAddress node, TKey key, TValue element)
Parameters
Returns
|
Improve this Doc
View Source
ReplaceItem(Cluster, TKey, TValue, TValue)
Replace an element of a set associated with a key with a new one if it is different. This is useful when an element is removed
and another one is added within the same Update. The order of addition and removal is important in order
to retain history for replicated data.
Declaration
public ORMultiValueDictionary<TKey, TValue> ReplaceItem(Cluster node, TKey key, TValue oldElement, TValue newElement)
Parameters
Type |
Name |
Description |
Cluster |
node |
|
TKey |
key |
|
TValue |
oldElement |
|
TValue |
newElement |
|
Returns
|
Improve this Doc
View Source
ReplaceItem(UniqueAddress, TKey, TValue, TValue)
Replace an element of a set associated with a key with a new one if it is different. This is useful when an element is removed
and another one is added within the same Update. The order of addition and removal is important in order
to retain history for replicated data.
Declaration
public ORMultiValueDictionary<TKey, TValue> ReplaceItem(UniqueAddress node, TKey key, TValue oldElement, TValue newElement)
Parameters
Type |
Name |
Description |
UniqueAddress |
node |
|
TKey |
key |
|
TValue |
oldElement |
|
TValue |
newElement |
|
Returns
|
Improve this Doc
View Source
ResetDelta()
Declaration
public ORMultiValueDictionary<TKey, TValue> ResetDelta()
Returns
|
Improve this Doc
View Source
SetItems(Cluster, TKey, IImmutableSet<TValue>)
Sets a bucket
of values inside current dictionary under provided key
in the context of the provided cluster node
.
Declaration
public ORMultiValueDictionary<TKey, TValue> SetItems(Cluster node, TKey key, IImmutableSet<TValue> bucket)
Parameters
Type |
Name |
Description |
Cluster |
node |
|
TKey |
key |
|
System.Collections.Immutable.IImmutableSet<TValue> |
bucket |
|
Returns
|
Improve this Doc
View Source
SetItems(UniqueAddress, TKey, IImmutableSet<TValue>)
Sets a bucket
of values inside current dictionary under provided key
in the context of the provided cluster node
.
Declaration
public ORMultiValueDictionary<TKey, TValue> SetItems(UniqueAddress node, TKey key, IImmutableSet<TValue> bucket)
Parameters
Type |
Name |
Description |
UniqueAddress |
node |
|
TKey |
key |
|
System.Collections.Immutable.IImmutableSet<TValue> |
bucket |
|
Returns
|
Improve this Doc
View Source
ToString()
Declaration
public override string ToString()
Returns
Overrides
|
Improve this Doc
View Source
TryGetValue(TKey, out IImmutableSet<TValue>)
Declaration
public bool TryGetValue(TKey key, out IImmutableSet<TValue> value)
Parameters
Type |
Name |
Description |
TKey |
key |
|
System.Collections.Immutable.IImmutableSet<TValue> |
value |
|
Returns
Explicit Interface Implementations
|
Improve this Doc
View Source
IDeltaReplicatedData.Delta
Declaration
IReplicatedDelta IDeltaReplicatedData.Delta { get; }
Returns
|
Improve this Doc
View Source
IDeltaReplicatedData.MergeDelta(IReplicatedDelta)
Declaration
IReplicatedData IDeltaReplicatedData.MergeDelta(IReplicatedDelta delta)
Parameters
Returns
|
Improve this Doc
View Source
IDeltaReplicatedData.ResetDelta()
Declaration
IReplicatedData IDeltaReplicatedData.ResetDelta()
Returns
|
Improve this Doc
View Source
IRemovedNodePruning.Prune(UniqueAddress, UniqueAddress)
Declaration
IReplicatedData IRemovedNodePruning.Prune(UniqueAddress removedNode, UniqueAddress collapseInto)
Parameters
Returns
|
Improve this Doc
View Source
IRemovedNodePruning.PruningCleanup(UniqueAddress)
Declaration
IReplicatedData IRemovedNodePruning.PruningCleanup(UniqueAddress removedNode)
Parameters
Returns
|
Improve this Doc
View Source
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Implements
Extension Methods