Class Index<TKey, TValue>
An implementation of a ConcurrentMultiMap - in CLR that would be something like
ConcurrentDictionary<TKey, TValue> where TValue
is another IEnumerable<T>.
Add/remove is serialized over the specified key. Reads are fully concurrent.
Inherited Members
Namespace: Akka.Util
Assembly: Akka.dll
Syntax
public class Index<TKey, TValue>
where TValue : IComparable<TValue>
Type Parameters
Name | Description |
---|---|
TKey | TBD |
TValue | TBD |
Constructors
| Improve this Doc View SourceIndex()
TBD
Declaration
public Index()
Properties
| Improve this Doc View SourceIsEmpty
Returns true
if the index is empty.
Declaration
public bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
Boolean |
Item[TKey]
TBD
Declaration
public IEnumerable<TValue> this[TKey index] { get; }
Parameters
Type | Name | Description |
---|---|---|
TKey | index | TBD |
Property Value
Type | Description |
---|---|
IEnumerable<TValue> |
Keys
Returns the key set.
Declaration
public ICollection<TKey> Keys { get; }
Property Value
Type | Description |
---|---|
ICollection<TKey> |
Values
Returns the union of all value sets.
Declaration
public HashSet<TValue> Values { get; }
Property Value
Type | Description |
---|---|
HashSet<TValue> |
Methods
| Improve this Doc View SourceClear()
Removes all keys and values
Declaration
public void Clear()
FindValue(TKey, Func<TValue, Boolean>)
Find some TValue
for the first matching value where the supplied
predicate
returns true
for the given key.
Declaration
public TValue FindValue(TKey key, Func<TValue, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
TKey | key | The key to use. |
Func<TValue, Boolean> | predicate | The predicate to filter values associated with |
Returns
Type | Description |
---|---|
TValue | The first |
ForEach(Action<TKey, TValue>)
Applies the supplied fun
to all keys and their values.
Declaration
public void ForEach(Action<TKey, TValue> fun)
Parameters
Type | Name | Description |
---|---|---|
Action<TKey, TValue> | fun | The function to apply. |
Put(TKey, TValue)
Associates the value of TValue
with key of type TKey
.
Declaration
public bool Put(TKey key, TValue value)
Parameters
Type | Name | Description |
---|---|---|
TKey | key | The key to add. |
TValue | value | The value to add. |
Returns
Type | Description |
---|---|
Boolean |
|
Remove(TKey)
Disassociates all values for the specified key.
Declaration
public IEnumerable<TValue> Remove(TKey key)
Parameters
Type | Name | Description |
---|---|---|
TKey | key | The key we're going to remove. |
Returns
Type | Description |
---|---|
IEnumerable<TValue> | An enumerable collection of |
Remove(TKey, TValue)
Disassociates the value of TValue
from
the key of TKey
.
Declaration
public bool Remove(TKey key, TValue value)
Parameters
Type | Name | Description |
---|---|---|
TKey | key | The key. |
TValue | value | The value. |
Returns
Type | Description |
---|---|
Boolean |
|
RemoveValue(TValue)
Remove the given value
from all keys.
Declaration
public void RemoveValue(TValue value)
Parameters
Type | Name | Description |
---|---|---|
TValue | value | The value we're going to remove, if it exists for any key. |