C5  2.4
The C5 Generic Collection Library for C# and CLI is a comprehensive collection library supporting lists, sets, bags, dictionaries, priority queues, (FIFO) queues, and (LIFO) stacks. C5 runs on .NET 3.5+, Silverlight 5, Windows Phone 8, Xamarin.iOS, Xamarin.Android, and Mono.
C5.HashDictionary< K, V > Class Template Reference

A generic dictionary class based on a hash set class T:C5.HashSet`1. More...

Inheritance diagram for C5.HashDictionary< K, V >:
C5.DictionaryBase< K, V > C5.IDictionary< K, V > C5.IDictionary< K, V >

Public Member Functions

 HashDictionary ()
 Create a hash dictionary using a default equalityComparer for the keys. Initial capacity of internal table will be 16 entries and threshold for expansion is 66% fill. More...
 
 HashDictionary (SCG.IEqualityComparer< K > keyequalityComparer)
 Create a hash dictionary using a custom equalityComparer for the keys. Initial capacity of internal table will be 16 entries and threshold for expansion is 66% fill. More...
 
 HashDictionary (int capacity, double fill, SCG.IEqualityComparer< K > keyequalityComparer)
 Create a hash dictionary using a custom equalityComparer and prescribing the initial size of the dictionary and a non-default threshold for internal table expansion. More...
 
- Public Member Functions inherited from C5.DictionaryBase< K, V >
virtual void Add (K key, V value)
 Add a new (key, value) pair (a mapping) to the dictionary. More...
 
virtual void AddAll< L, W > (SCG.IEnumerable< KeyValuePair< L, W >> entries)
 Add the entries from a collection of T:C5.KeyValuePair`2 pairs to this dictionary. More...
 
virtual bool Remove (K key)
 Remove an entry with a given key from the dictionary More...
 
virtual bool Remove (K key, out V value)
 Remove an entry with a given key from the dictionary and report its value. More...
 
virtual void Clear ()
 Remove all entries from the dictionary More...
 
virtual bool Contains (K key)
 Check if there is an entry with a specified key More...
 
virtual bool ContainsAll< H > (SCG.IEnumerable< H > keys)
 
virtual bool Find (ref K key, out V value)
 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]". More...
 
virtual bool Update (K key, V value)
 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". More...
 
virtual bool Update (K key, V value, out V oldvalue)
 
virtual bool FindOrAdd (K key, ref V value)
 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. More...
 
virtual bool UpdateOrAdd (K key, V value)
 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. More...
 
virtual bool UpdateOrAdd (K key, V value, out V oldvalue)
 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. More...
 
virtual bool Check ()
 Check the integrity of the internal data structures of this dictionary. More...
 
override KeyValuePair< K, V > Choose ()
 Choose some entry in this Dictionary. More...
 
override SCG.IEnumerator< KeyValuePair< K, V > > GetEnumerator ()
 Create an enumerator for the collection of entries of the dictionary More...
 
override bool Show (System.Text.StringBuilder stringbuilder, ref int rest, IFormatProvider formatProvider)
 
- Public Member Functions inherited from C5.IDictionary< K, V >
void AddAll< U, W > (SCG.IEnumerable< KeyValuePair< U, W >> entries)
 Add the entries from a collection of T:C5.KeyValuePair`2 pairs to this dictionary. More...
 

Additional Inherited Members

- Protected Member Functions inherited from C5.DictionaryBase< K, V >
 DictionaryBase (SCG.IEqualityComparer< K > keyequalityComparer)
 
- Protected Attributes inherited from C5.DictionaryBase< K, V >
ICollection< KeyValuePair< K, V > > pairs
 The set collection of entries underlying this dictionary implementation More...
 
- Properties inherited from C5.DictionaryBase< K, V >
override CollectionChangedHandler< KeyValuePair< K, V > > CollectionChanged
 The change event. Will be raised for every change operation on the collection. More...
 
override CollectionClearedHandler< KeyValuePair< K, V > > CollectionCleared
 The change event. Will be raised for every change operation on the collection. More...
 
override ItemsAddedHandler< KeyValuePair< K, V > > ItemsAdded
 The item added event. Will be raised for every individual addition to the collection. More...
 
override ItemsRemovedHandler< KeyValuePair< K, V > > ItemsRemoved
 The item added event. Will be raised for every individual removal from the collection. More...
 
override EventTypeEnum ListenableEvents [get]
 
override EventTypeEnum ActiveEvents [get]
 
virtual SCG.IEqualityComparer< K > EqualityComparer [get]
 
virtual Speed ContainsSpeed [get]
 
virtual ICollectionValue< K > Keys [get]
 
virtual ICollectionValue< V > Values [get]
 
virtual Func< K, V > Func [get]
 
virtual V this[K key] [get, set]
 Indexer by key for dictionary. More...
 
virtual bool IsReadOnly [get]
 
override bool IsEmpty [get]
 
override int Count [get]
 
override Speed CountSpeed [get]
 
- Properties inherited from C5.IDictionary< K, V >
SCG.IEqualityComparer< K > EqualityComparer [get]
 The key equalityComparer. More...
 
this[K key] [get, set]
 Indexer for dictionary. More...
 
bool IsReadOnly [get]
 
ICollectionValue< K > Keys [get]
 
ICollectionValue< V > Values [get]
 
Func< K, V > Func [get]
 
Speed ContainsSpeed [get]
 The value is symbolic indicating the type of asymptotic complexity in terms of the size of this collection (worst-case or amortized as relevant). More...
 

Detailed Description

A generic dictionary class based on a hash set class T:C5.HashSet`1.

Constructor & Destructor Documentation

Create a hash dictionary using a default equalityComparer for the keys. Initial capacity of internal table will be 16 entries and threshold for expansion is 66% fill.

C5.HashDictionary< K, V >.HashDictionary ( SCG.IEqualityComparer< K >  keyequalityComparer)

Create a hash dictionary using a custom equalityComparer for the keys. Initial capacity of internal table will be 16 entries and threshold for expansion is 66% fill.

Parameters
keyequalityComparerThe external key equalitySCG.Comparer
C5.HashDictionary< K, V >.HashDictionary ( int  capacity,
double  fill,
SCG.IEqualityComparer< K >  keyequalityComparer 
)

Create a hash dictionary using a custom equalityComparer and prescribing the initial size of the dictionary and a non-default threshold for internal table expansion.

Parameters
capacityThe initial capacity. Will be rounded upwards to nearest power of 2, at least 16.
fillThe expansion threshold. Must be between 10% and 90%.
keyequalityComparerThe external key equalitySCG.Comparer

The documentation for this class was generated from the following file: