Click or drag to resize
Accord.NET (logo)

TwoWayDictionaryTFirst, TSecond Class

Two-way dictionary for efficient lookups by both key and value. This can be used to represent a one-to-one relation among two object types.
Inheritance Hierarchy
SystemObject
  Accord.CollectionsTwoWayDictionaryTFirst, TSecond

Namespace:  Accord.Collections
Assembly:  Accord (in Accord.dll) Version: 3.8.0
Syntax
[SerializableAttribute]
public sealed class TwoWayDictionary<TFirst, TSecond> : IEnumerable, 
	IDictionary, ICollection
Request Example View Source

Type Parameters

TFirst
The type of right keys in the dictionary.
TSecond
The type of left keys in the dictionary.

The TwoWayDictionaryTFirst, TSecond type exposes the following members.

Constructors
  NameDescription
Public methodTwoWayDictionaryTFirst, TSecond
Initializes a new instance of the TwoWayDictionaryTFirst, TSecond class that is empty, has the default initial capacity, and uses the default equality comparer for the key type.
Public methodTwoWayDictionaryTFirst, TSecond(IDictionaryTFirst, TSecond)
Initializes a new instance of the TwoWayDictionaryTFirst, TSecond class that contains elements copied from the specified dictionary and uses the default equality comparer for the key type.
Public methodTwoWayDictionaryTFirst, TSecond(Int32)
Initializes a new instance of the TwoWayDictionaryTFirst, TSecond class that is empty, has the specified initial capacity, and uses the default equality comparer for the key type.
Top
Properties
  NameDescription
Public propertyCount
Gets the number of elements contained in this TwoWayDictionaryTFirst, TSecond.
Public propertyIsReadOnly
Gets a value indicating whether the ICollectionT is read-only.
Public propertyItem
Gets or sets the element with the specified key.
Public propertyKeys
Gets an ICollectionT containing the keys of the IDictionaryTKey, TValue.
Public propertyReverse
Gets the reverse dictionary that maps values back to keys.
Public propertyValues
Gets an ICollectionT containing the values in the IDictionaryTKey, TValue.
Top
Methods
  NameDescription
Public methodAdd
Adds an element with the provided key and value to the IDictionaryTKey, TValue.
Public methodClear
Removes all items from the ICollectionT.
Public methodContainsKey
Determines whether the IDictionaryTKey, TValue contains an element with the specified key.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetEnumerator
Returns an enumerator that iterates through the collection.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodRemove
Removes the element with the specified key from the IDictionaryTKey, TValue.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodTryGetValue
Gets the value associated with the specified key.
Top
Extension Methods
  NameDescription
Public Extension MethodHasMethod
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.)
Public Extension MethodIsEqual
Compares two objects for equality, performing an elementwise comparison if the elements are vectors or matrices.
(Defined by Matrix.)
Public Extension MethodSetEqualsKeyValuePairTFirst, TSecond
Compares two enumerables for set equality. Two enumerables are set equal if they contain the same elements, but not necessarily in the same order.
(Defined by Matrix.)
Public Extension MethodTo(Type)Overloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Public Extension MethodToTOverloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Top
See Also