Click or drag to resize

OrderedDictionaryTKey, TValue Class

Represents an ordered collection of keys and values with the same performance as DictionaryTKey, TValue with O(1) lookups and adds but with O(n) inserts and removes.
Inheritance Hierarchy
SystemObject
  GSF.CollectionsOrderedDictionaryTKey, TValue

Namespace: GSF.Collections
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.181-beta
Syntax
public class OrderedDictionary<TKey, TValue> : IDictionary<TKey, TValue>, 
	ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, 
	IEnumerable, IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, 
	IList<KeyValuePair<TKey, TValue>>, IReadOnlyList<KeyValuePair<TKey, TValue>>
View Source

Type Parameters

TKey
The type of the keys in the dictionary.
TValue
The type of the values in the dictionary.

The OrderedDictionaryTKey, TValue type exposes the following members.

Constructors
 NameDescription
Public methodOrderedDictionaryTKey, TValue Initializes a new instance of the OrderedDictionaryTKey, TValue class that is empty, has the default initial capacity, and uses the default equality comparer for the key type.
Public methodOrderedDictionaryTKey, TValue(IEnumerableKeyValuePairTKey, TValue) Initializes a new instance of the OrderedDictionaryTKey, TValue class that contains elements copied from the specified [!:IEnumerable<KeyValuePair<TKey, TValue>>] and uses the default equality comparer for the key type.
Public methodOrderedDictionaryTKey, TValue(IEqualityComparerTKey) Initializes a new instance of the OrderedDictionaryTKey, TValue class that is empty, has the default initial capacity, and uses the specified IEqualityComparerT.
Public methodOrderedDictionaryTKey, TValue(Int32) Initializes a new instance of the OrderedDictionaryTKey, TValue class that is empty, has the specified initial capacity, and uses the default equality comparer for the key type.
Public methodOrderedDictionaryTKey, TValue(IEnumerableKeyValuePairTKey, TValue, IEqualityComparerTKey) Initializes a new instance of the OrderedDictionaryTKey, TValue class that contains elements copied from the specified [!:IEnumerable<KeyValuePair<TKey, TValue>>] and uses the specified IEqualityComparerT.
Public methodOrderedDictionaryTKey, TValue(Int32, IEqualityComparerTKey) Initializes a new instance of the OrderedDictionaryTKey, TValue class that is empty, has the specified initial capacity, and uses the specified IEqualityComparerT.
Top
Properties
 NameDescription
Public propertyComparer Gets the IEqualityComparerT that is used to determine equality of keys for the dictionary.
Public propertyCount Gets the number of key/value pairs contained in the OrderedDictionaryTKey, TValue.
Public propertyItemInt32 Gets or sets the value at the specified index as an O(1) operation.
Public propertyItemTKey Gets or sets the value associated with the specified key as an O(1) operation.
Public propertyKeys Gets a collection containing the keys in the OrderedDictionaryTKey, TValue.
Public propertyValues Gets a collection containing the values in the OrderedDictionaryTKey, TValue.
Top
Methods
 NameDescription
Public methodAdd Adds the specified key and value to the dictionary as an O(1) operation.
Public methodClear Removes all keys and values from the OrderedDictionaryTKey, TValue.
Public methodContainsKey Determines whether the OrderedDictionaryTKey, TValue contains the specified key as an O(1) operation.
Public methodEnsureCapacity Resizes the internal data structure if necessary to ensure no additional resizing to support the specified capacity.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetEnumerator Returns an enumerator that iterates through the OrderedDictionaryTKey, TValue.
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetOrAdd(TKey, TValue) Adds a key/value pair to the OrderedDictionaryTKey, TValue if the key does not already exist as an O(1) operation.
Public methodGetOrAdd(TKey, FuncTValue) Adds a key/value pair to the OrderedDictionaryTKey, TValue by using the specified function, if the key does not already exist as an O(1) operation.
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodIndexOf Returns the zero-based index of the element with the specified key within the OrderedDictionaryTKey, TValue as an O(1) operation.
Public methodInsert Inserts the specified key/value pair into the OrderedDictionaryTKey, TValue at the specified index as an O(n) operation.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodMove Moves the element at the specified fromIndex to the specified toIndex while re-arranging the elements in between.
Public methodMoveRange Moves the specified number of elements at the specified fromIndex to the specified toIndex while re-arranging the elements in between.
Public methodRemove(TKey) Removes the value with the specified key from the OrderedDictionaryTKey, TValue as an O(n) operation.
Public methodRemove(TKey, TValue) Removes the value with the specified key from the OrderedDictionaryTKey, TValue and returns the value as an O(n) operation.
Public methodRemoveAt Removes the value at the specified index from the OrderedDictionaryTKey, TValue as an O(n) operation.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Public methodTrimExcess Sets the capacity of an OrderedDictionaryTKey, TValue object to the actual number of elements it contains, rounded up to a nearby, implementation-specific value.
Public methodTrimExcess(Int32) Sets the capacity of an OrderedDictionaryTKey, TValue object to the specified capacity, rounded up to a nearby, implementation-specific value.
Public methodTryAdd Tries to add the specified key and value to the dictionary as an O(1) operation.
Public methodTryGetValue Gets the value associated with the specified key as an O(1) operation.
Top
Extension Methods
 NameDescription
Public Extension MethodAddRangeKeyValuePairTKey, TValue Adds the specified items to the collection.
(Defined by CollectionExtensions)
Public Extension MethodAllParallelKeyValuePairTKey, TValue Determines whether all elements of a sequence satisfy a condition with each item being tested in parallel.
(Defined by CollectionExtensions)
Public Extension MethodDistinctByKeyValuePairTKey, TValue, TKey Returns only the elements whose keys are distinct.
(Defined by CollectionExtensions)
Public Extension MethodGetEnumValueOrDefault Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodGetEnumValueOrDefaultT Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodGetRangeKeyValuePairTKey, TValue Returns elements in the specified range from the collection.
(Defined by CollectionExtensions)
Public Extension MethodIndexOfKeyValuePairTKey, TValue Returns the index of the first element of the sequence that satisfies a condition or -1 if no such element is found.
(Defined by CollectionExtensions)
Public Extension MethodLoadDelimitedStringKeyValuePairTKey, TValueAppends items parsed from delimited string, created with ToDelimitedString, using the default delimiter ("|") into the given list.
(Defined by CollectionExtensions)
Public Extension MethodLoadDelimitedStringKeyValuePairTKey, TValueAppends items parsed from delimited string, created with ToDelimitedString, into the given list.
(Defined by CollectionExtensions)
Public Extension MethodLoadDelimitedStringKeyValuePairTKey, TValueAppends items parsed from delimited string, created with ToDelimitedString, into the given list.
(Defined by CollectionExtensions)
Public Extension MethodMajorityKeyValuePairTKey, TValue Returns the majority value in the collection, or default type value if no item represents the majority.
(Defined by CollectionExtensions)
Public Extension MethodMajorityKeyValuePairTKey, TValue Returns the majority value in the collection, or defaultValue if no item represents the majority.
(Defined by CollectionExtensions)
Public Extension MethodMajorityByKeyValuePairTKey, TValue, TKey Returns the majority value in the collection, or default type value if no item represents the majority.
(Defined by CollectionExtensions)
Public Extension MethodMajorityByKeyValuePairTKey, TValue, TKey Returns the majority value in the collection, or defaultValue if no item represents the majority.
(Defined by CollectionExtensions)
Public Extension MethodMaxKeyValuePairTKey, TValueReturns the largest item from the enumeration.
(Defined by CollectionExtensions)
Public Extension MethodMaxKeyValuePairTKey, TValueReturns the largest item from the enumeration.
(Defined by CollectionExtensions)
Public Extension MethodMaxByKeyValuePairTKey, TValue, TKeySelects the largest item from the enumeration.
(Defined by CollectionExtensions)
Public Extension MethodMedianKeyValuePairTKey, TValue Gets the median item(s) from an enumeration, i.e., one return item for odd lengths, two for even lengths.
(Defined by CollectionExtensions)
Public Extension MethodMinKeyValuePairTKey, TValueReturns the smallest item from the enumeration.
(Defined by CollectionExtensions)
Public Extension MethodMinKeyValuePairTKey, TValueReturns the smallest item from the enumeration.
(Defined by CollectionExtensions)
Public Extension MethodMinByKeyValuePairTKey, TValue, TKeySelects the smallest item from the enumeration.
(Defined by CollectionExtensions)
Public Extension MethodMinorityKeyValuePairTKey, TValue Returns the minority value in the collection, or default type value if no item represents the minority.
(Defined by CollectionExtensions)
Public Extension MethodMinorityKeyValuePairTKey, TValue Returns the minority value in the collection, or defaultValue if no item represents the minority.
(Defined by CollectionExtensions)
Public Extension MethodMinorityByKeyValuePairTKey, TValue, TKey Returns the minority value in the collection, or default type value if no item represents the majority.
(Defined by CollectionExtensions)
Public Extension MethodMinorityByKeyValuePairTKey, TValue, TKey Returns the minority value in the collection, or defaultValue if no item represents the majority.
(Defined by CollectionExtensions)
Public Extension MethodScrambleKeyValuePairTKey, TValue Rearranges all the elements in the list into a highly-random order.
(Defined by CollectionExtensions)
Public Extension MethodScrambleKeyValuePairTKey, TValue Rearranges all the elements in the list into a repeatable pseudo-random order.
(Defined by CollectionExtensions)
Public Extension MethodStandardDeviationKeyValuePairTKey, TValue Computes the standard deviation over a sequence of Double values.
(Defined by NumericalAnalysisExtensions)
Public Extension MethodStandardDeviationKeyValuePairTKey, TValue Computes the standard deviation over a sequence of Decimal values.
(Defined by NumericalAnalysisExtensions)
Public Extension MethodStandardDeviationKeyValuePairTKey, TValue Computes the standard deviation over a sequence of Single values.
(Defined by NumericalAnalysisExtensions)
Public Extension MethodToDelimitedStringKeyValuePairTKey, TValueConverts an enumeration to a string, using the default delimiter ("|") that can later be converted back to a list using LoadDelimitedString.
(Defined by CollectionExtensions)
Public Extension MethodToDelimitedStringKeyValuePairTKey, TValueConverts an enumeration to a string that can later be converted back to a list using LoadDelimitedString.
(Defined by CollectionExtensions)
Public Extension MethodToDelimitedStringKeyValuePairTKey, TValueConverts an enumeration to a string that can later be converted back to a list using LoadDelimitedString.
(Defined by CollectionExtensions)
Public Extension MethodToPagedListKeyValuePairTKey, TValue Gets a PagedListT to paginate source enumeration for a given page and specified pageSize.
(Defined by CollectionExtensions)
Public Extension MethodUnscrambleKeyValuePairTKey, TValue Rearranges all the elements in the list previously scrambled with ScrambleTSource(IListTSource, Int32) back into their original order.
(Defined by CollectionExtensions)
Public Extension MethodUpdateRangeKeyValuePairTKey, TValue Updates collection starting at the index with the specified items.
(Defined by CollectionExtensions)
Top
See Also