Click or drag to resize

FastDictionaryTKey, TValue Class

Represents a collection of keys and values optimized for speed.
Inheritance Hierarchy
SystemObject
  Cauldron.CollectionsFastDictionaryTKey, TValue

Namespace:  Cauldron.Collections
Assembly:  Cauldron.Collections (in Cauldron.Collections.dll) Version: 1.0.0
Syntax
public class FastDictionary<TKey, TValue> : IDictionary<TKey, TValue>, 
	ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, 
	IEnumerable, IEnumerable<TValue>
where TKey : class
where TValue : class

Type Parameters

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

The FastDictionaryTKey, TValue type exposes the following members.

Constructors
  NameDescription
Public methodFastDictionaryTKey, TValue
Initializes a new instance of FastDictionaryTKey, TValue.
Public methodFastDictionaryTKey, TValue(Int32)
Initializes a new instance of FastDictionaryTKey, TValue.
Top
Properties
  NameDescription
Public propertyCount
Gets the number of key/value pairs contained in the FastDictionaryTKey, TValue.
Public propertyIsReadOnly
Gets a value indicating whether the IDictionary is read-only.
Public propertyItem
Gets or sets the value associated with the specified key.
Public propertyKeys
Gets an ICollection containing the keys of the IDictionary.
Public propertyValues
Gets an ICollection containing the values of the IDictionary.
Top
Methods
  NameDescription
Public methodAdd(KeyValuePairTKey, TValue)
Adds the specified key and value to the dictionary.
Public methodAdd(TKey, TValue)
Adds the specified key and value to the dictionary.
Public methodClear
Removes all keys and values from the FastDictionaryTKey, TValue.
Public methodContains
Determines whether the FastDictionaryTKey, TValue contains the specified key.
Public methodContainsKey
Determines whether the FastDictionaryTKey, TValue contains the specified key.
Public methodCopyTo
Copies the elements of the FastDictionaryTKey, TValue to an Array, starting at a particular Array index.
Public methodGetEnumerator
Returns an enumerator that iterates through the collection.
Public methodRemove(KeyValuePairTKey, TValue)
Removes the value with the specified key from the FastDictionaryTKey, TValue.
Public methodRemove(TKey)
Removes the value with the specified key from the FastDictionaryTKey, TValue.
Public methodTryGetValue
Gets the value associated with the specified key.
Top
Extension Methods
  NameDescription
Public Extension MethodAppendKeyValuePairTKey, TValue(KeyValuePairTKey, TValue)Overloaded.
Concatenates an item into a sequences.
(Defined by Extensions.)
Public Extension MethodAppendTValue(TValue)Overloaded. (Defined by Extensions.)
Public Extension MethodCode exampleAs(Type)Overloaded.
Converts a type using the implicit or explicit operators. If both fails it will try to convert the value with ChangeType(Object, Type).
(Defined by ExtensionsConvertions.)
Public Extension MethodCode exampleAs(Type, Type)Overloaded.
Converts a type using the implicit or explicit operators. If both fails it will try to convert the value with ChangeType(Object, Type).
(Defined by ExtensionsConvertions.)
Public Extension MethodCode exampleAsTOverloaded.
Performs a cast between compatible reference types. If a convertion is not possible then null is returned. As a last resort it will use ChangeType(Object, Type).

Tries to use the implicit and explicit operators if exists when convertion with 'as' returns null.

(Defined by ExtensionsConvertions.)
Public Extension MethodCode exampleCreateTypeT
Creates a new Type that implements the properties of an interface defined by T and copies all value of anon to the new object.
(Defined by ExtensionsInterception.)
Public Extension MethodDistinctKeyValuePairTKey, TValue(FuncKeyValuePairTKey, TValue, KeyValuePairTKey, TValue, Boolean)Overloaded.
Returns distinct elements from a sequence by using a selector to compare values.
(Defined by Extensions.)
Public Extension MethodDistinctTValue(FuncTValue, TValue, Boolean)Overloaded. (Defined by Extensions.)
Public Extension MethodForeachKeyValuePairTKey, TValue(ActionKeyValuePairTKey, TValue)Overloaded. (Defined by Extensions.)
Public Extension MethodForeachTValue(ActionTValue)Overloaded. (Defined by Extensions.)
Public Extension MethodGetPropertyNonPublicValueT
Searches for the specified property, using the specified binding constraints and returns its value.

Default BindingFlags are Instance and NonPublic

(Defined by ExtensionsReflection.)
Public Extension MethodGetPropertyValue(String, BindingFlags)Overloaded.
Searches for the specified property, using the specified binding constraints and returns its value.
(Defined by ExtensionsReflection.)
Public Extension MethodGetPropertyValueT(String)Overloaded.
Searches for the specified property, using the specified binding constraints and returns its value.

Default BindingFlags are Instance and Public

(Defined by ExtensionsReflection.)
Public Extension MethodGetPropertyValueT(String, BindingFlags)Overloaded.
Searches for the specified property, using the specified binding constraints and returns its value.
(Defined by ExtensionsReflection.)
Public Extension MethodInterleaveKeyValuePairTKey, TValue(IEnumerableKeyValuePairTKey, TValue)Overloaded.
Interleve combine two collections.
(Defined by Extensions.)
Public Extension MethodInterleaveTValue(IEnumerableTValue)Overloaded. (Defined by Extensions.)
Public Extension MethodJoinKeyValuePairTKey, TValue(String)Overloaded.
Concatenates the members of a collection, using the specified separator between each member.
(Defined by Extensions.)
Public Extension MethodJoinTValue(String)Overloaded. (Defined by Extensions.)
Public Extension MethodMapToT
Maps all properties and fields of an instance to another instance. The Clone() method is used to copy an instance if exist.

Mapping fails on jagged and multidimensional array. Classes without parameterless constructor will stay null.

(Defined by ExtensionsCloning.)
Public Extension MethodMaxByKeyValuePairTKey, TValue, TKey(FuncKeyValuePairTKey, TValue, TKey)Overloaded.
Returns the item with the maximum value in a sequence of values.
(Defined by Extensions.)
Public Extension MethodMaxByTValue, TKey(FuncTValue, TKey)Overloaded. (Defined by Extensions.)
Public Extension MethodMaxByKeyValuePairTKey, TValue, TKey(FuncKeyValuePairTKey, TValue, TKey, IComparerTKey)Overloaded.
Returns the item with the maximum value in a sequence of values.
(Defined by Extensions.)
Public Extension MethodMaxByTValue, TKey(FuncTValue, TKey, IComparerTKey)Overloaded. (Defined by Extensions.)
Public Extension MethodMinByKeyValuePairTKey, TValue, TKey(FuncKeyValuePairTKey, TValue, TKey)Overloaded.
Returns the item with the minimum value in a sequence of values.
(Defined by Extensions.)
Public Extension MethodMinByTValue, TKey(FuncTValue, TKey)Overloaded. (Defined by Extensions.)
Public Extension MethodMinByKeyValuePairTKey, TValue, TKey(FuncKeyValuePairTKey, TValue, TKey, IComparerTKey)Overloaded.
Returns the item with the minimum value in a sequence of values.
(Defined by Extensions.)
Public Extension MethodMinByTValue, TKey(FuncTValue, TKey, IComparerTKey)Overloaded. (Defined by Extensions.)
Public Extension MethodOperations
Provides linq like methods for handling and converting IEnumerables.

This is separated from actual extension to avoid confusions with System.Linq extensions. And also to avoid accidental usage.

(Defined by Extensions.)
Public Extension MethodToArray
Converts a IEnumerable to an array
(Defined by ExtensionsConvertions.)
Public Extension MethodToLong
Tries to convert a Object to an Int64. Returns MinValue if target cannot be parsed.
(Defined by ExtensionsConvertions.)
Public Extension MethodToStringEx(String)Overloaded.
Converts the value of this instance to its equivalent string representation, using the specified format.

The following custom formatter are already added: ByteSizeFormatter, MetricUnitFormatter

(Defined by Extensions.)
Public Extension MethodToStringEx(String, CultureInfo)Overloaded.
Converts the value of this instance to its equivalent string representation, using the specified format.

The following custom formatter are already added: ByteSizeFormatter, MetricUnitFormatter

(Defined by Extensions.)
Public Extension MethodTryDispose
Tries to performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

This will dispose an object if it implements the IDisposable interface.

(Defined by Extensions.)
Top
Explicit Interface Implementations
See Also