Class DictionaryBase<K, V>
A base class for implementing a dictionary based on a set collection implementation. See the source code for C5.HashDictionary`2 for an example
Inheritance
Inherited Members
Assembly: DistributedLucene.Net.dll
Syntax
public abstract class DictionaryBase<K, V> : CollectionValueBase<KeyValuePair<K, V>>, IDictionary<K, V>, ICollectionValue<KeyValuePair<K, V>>, Collections.Generic.IEnumerable<KeyValuePair<K, V>>, IShowable, IFormattable
Type Parameters
Name | Description |
---|---|
K | |
V |
Constructors
Name | Description |
---|---|
DictionaryBase(Collections.Generic.IEqualityComparer<K>, MemoryType) |
Fields
Name | Description |
---|---|
pairs | The set collection of entries underlying this dictionary implementation |
Properties
Name | Description |
---|---|
ActiveEvents | |
ContainsSpeed | |
Count | |
CountSpeed | |
EqualityComparer | |
Func | |
IsEmpty | |
IsReadOnly | |
Item[K] | Indexer by key for dictionary. The get method will throw an exception if no entry is found. The set method behaves like C5.DictionaryBase`2.UpdateOrAdd(`0,`1). |
Keys | |
ListenableEvents | |
Values |
Methods
Name | Description |
---|---|
Add(K, V) | Add a new (key, value) pair (a mapping) to the dictionary. |
AddAll<L, W>(Collections.Generic.IEnumerable<KeyValuePair<L, W>>) | Add the entries from a collection of C5.KeyValuePair`2 pairs to this dictionary. TODO: add restrictions L:K and W:V when the .Net SDK allows it |
Check() | Check the integrity of the internal data structures of this dictionary. |
Choose() | Choose some entry in this Dictionary. |
Clear() | Remove all entries from the dictionary |
Contains(K) | Check if there is an entry with a specified key |
ContainsAll<H>(Collections.Generic.IEnumerable<H>) | |
Find(ref K, out V) | Check if there is an entry with a specified key and report the corresponding value if found. This can be seen as a safe form of "val = this[key]". |
FindOrAdd(K, ref V) | Look for a specific key in the dictionary. If found, report the corresponding value, else add an entry with the key and the supplied value. |
GetEnumerator() | Create an enumerator for the collection of entries of the dictionary |
Remove(K) | Remove an entry with a given key from the dictionary |
Remove(K, out V) | Remove an entry with a given key from the dictionary and report its value. |
Show(Text.StringBuilder, ref Int32, IFormatProvider) | |
Update(K, V) | Look for a specific key in the dictionary and if found replace the value with a new one. This can be seen as a non-adding version of "this[key] = val". |
Update(K, V, out V) | |
UpdateOrAdd(K, V) | Update value in dictionary corresponding to key if found, else add new entry. More general than "this[key] = val;" by reporting if key was found. |
UpdateOrAdd(K, V, out V) | Update value in dictionary corresponding to key if found, else add new entry. More general than "this[key] = val;" by reporting if key was found and the old value if any. |
Events
Name | Description |
---|---|
CollectionChanged | The change event. Will be raised for every change operation on the collection. |
CollectionCleared | The change event. Will be raised for every change operation on the collection. |
ItemsAdded | The item added event. Will be raised for every individual addition to the collection. |
ItemsRemoved | The item added event. Will be raised for every individual removal from the collection. |