Dictionary that preserves the insertion order during enumeration. More...
Public Member Functions | |
OrderedDictionary (IEqualityComparer< TKey > comparer) | |
Constructs a new OrderedDictionary<TKey,TValue> with the specified comparer and the default capacity. More... | |
OrderedDictionary (int capacity=0, IEqualityComparer< TKey > comparer=null) | |
Constructs a new OrderedDictionary<TKey,TValue> with the specified capacity and comparer. More... | |
bool | TryGetValue (TKey key, out TValue value) |
Gets the value associated with the specified key. More... | |
bool | ContainsKey (TKey key) |
Returns whether the dictionary contains the specified key. More... | |
void | Add (TKey key, TValue value) |
Adds a new entry with the specified key and value into the dictionary. More... | |
bool | Remove (TKey key) |
Removes the entry with the specified key from the dictionary. More... | |
void | Clear () |
Clears the dictionary. More... | |
IEnumerator< KeyValuePair< TKey, TValue > > | GetEnumerator () |
Returns an enumerator over pairs in this dictionary More... | |
void | GetObjectData (SerializationInfo info, StreamingContext context) |
Adds the proper information for serialization. More... | |
Protected Member Functions | |
OrderedDictionary (SerializationInfo info, StreamingContext context) | |
Constructor for deserialization. More... | |
Properties | |
TValue | this[TKey key] [get, set] |
Gets or sets a value for the specified key. More... | |
int | Count [get] |
Gets the number pairs in the dictionary. More... | |
bool | IsReadOnly [get] |
Always returns false, as this implementation is not read only. More... | |
ICollection< TKey > | Keys [get] |
Gets the collection of keys in the correct order. More... | |
ICollection< TValue > | Values [get] |
Gets the collection of values in the correct order. More... | |
Detailed Description
Dictionary that preserves the insertion order during enumeration.
- Template Parameters
-
TKey The type of keys in the dictionary. TValue The type of values in the dictionary.
Constructor & Destructor Documentation
Summer.Batch.Common.Collections.OrderedDictionary< TKey, TValue >.OrderedDictionary | ( | IEqualityComparer< TKey > | comparer | ) |
Constructs a new OrderedDictionary<TKey,TValue> with the specified comparer and the default capacity.
- Parameters
-
comparer Comparer to use when comparing keys
Summer.Batch.Common.Collections.OrderedDictionary< TKey, TValue >.OrderedDictionary | ( | int | capacity = 0 , |
IEqualityComparer< TKey > | comparer = null |
||
) |
Constructs a new OrderedDictionary<TKey,TValue> with the specified capacity and comparer.
- Parameters
-
capacity Initial number of elements that the dictionary can contain. comparer Comparer to use when comparing keys
- Exceptions
-
ArgumentOutOfRangeException capacity is less than 0
|
protected |
Constructor for deserialization.
- Parameters
-
info the info holding the serialization data context the serialization context
Member Function Documentation
void Summer.Batch.Common.Collections.OrderedDictionary< TKey, TValue >.Add | ( | TKey | key, |
TValue | value | ||
) |
Adds a new entry with the specified key and value into the dictionary.
- Parameters
-
key The key to add. value The value to add.
void Summer.Batch.Common.Collections.OrderedDictionary< TKey, TValue >.Clear | ( | ) |
Clears the dictionary.
bool Summer.Batch.Common.Collections.OrderedDictionary< TKey, TValue >.ContainsKey | ( | TKey | key | ) |
Returns whether the dictionary contains the specified key.
- Parameters
-
key The key to check.
- Returns
- whether the key exists in the dictionary.
IEnumerator<KeyValuePair<TKey, TValue> > Summer.Batch.Common.Collections.OrderedDictionary< TKey, TValue >.GetEnumerator | ( | ) |
Returns an enumerator over pairs in this dictionary
- Returns
- The enumerator
void Summer.Batch.Common.Collections.OrderedDictionary< TKey, TValue >.GetObjectData | ( | SerializationInfo | info, |
StreamingContext | context | ||
) |
Adds the proper information for serialization.
- Parameters
-
info the info holding the serialization data context the serialization context
bool Summer.Batch.Common.Collections.OrderedDictionary< TKey, TValue >.Remove | ( | TKey | key | ) |
Removes the entry with the specified key from the dictionary.
- Parameters
-
key The key to remove
- Returns
- whether the key was found in the dictionary and an actual removal happened
- Exceptions
-
ArgumentNullException if key is null
bool Summer.Batch.Common.Collections.OrderedDictionary< TKey, TValue >.TryGetValue | ( | TKey | key, |
out TValue | value | ||
) |
Gets the value associated with the specified key.
- Parameters
-
key The key of the value to get. value Contains the value associated with the specified key, if the key is found.
- Returns
- Whether the key is found.
Property Documentation
|
get |
Gets the number pairs in the dictionary.
The number pairs in the dictionary.
|
get |
Always returns false, as this implementation is not read only.
false.
|
get |
Gets the collection of keys in the correct order.
A collection of keys in the correct order.
|
getset |
Gets or sets a value for the specified key.
- Parameters
-
key The key to get or set.
- Returns
- The value for the specified key or
null
if it does not exist.
|
get |
Gets the collection of values in the correct order.
A collection of values in the correct order.
The documentation for this class was generated from the following file:
- Summer.Batch.Common/Collections/OrderedDictionary.cs