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 | The type of keys in the index. | 
| TValue | The type of values associated with each key in the index. | 
Constructors
| Edit this page View SourceIndex()
Initializes a new instance of the Index<TKey, TValue> class.
Declaration
public Index()Properties
| Edit this page View SourceIsEmpty
Returns true if the index is empty.
Declaration
public bool IsEmpty { get; }Property Value
| Type | Description | 
|---|---|
| bool | 
this[TKey]
Gets the collection of values associated with the specified key.
Declaration
public IEnumerable<TValue> this[TKey index] { get; }Parameters
| Type | Name | Description | 
|---|---|---|
| TKey | index | The key whose associated values are to be retrieved. | 
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
| Edit this page View SourceClear()
Removes all keys and values
Declaration
public void Clear()FindValue(TKey, Func<TValue, bool>)
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, bool> | 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 | 
|---|---|
| bool | 
 | 
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 | 
|---|---|
| bool | 
 | 
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. | 
 Edit this page
Edit this page