Class KeyValuePairEqualityComparer<K, V>
Default equalityComparer for dictionary entries. Operations only look at keys and uses an externally defined equalityComparer for that.
Inheritance
System.Object
KeyValuePairEqualityComparer<K, V>
Implements
System.Collections.Generic.IEqualityComparer<KeyValuePair<K, V>>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Lucene.Net.Support.C5
Assembly: Lucene.Net.dll
Syntax
public sealed class KeyValuePairEqualityComparer<K, V> : IEqualityComparer<KeyValuePair<K, V>>
Type Parameters
Name | Description |
---|---|
K | |
V |
Constructors
| Improve this Doc View SourceKeyValuePairEqualityComparer()
Create an entry equalityComparer using the default equalityComparer for keys
Declaration
public KeyValuePairEqualityComparer()
KeyValuePairEqualityComparer(IEqualityComparer<K>)
Create an entry equalityComparer from a specified item equalityComparer for the keys
Declaration
public KeyValuePairEqualityComparer(IEqualityComparer<K> keyequalityComparer)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEqualityComparer<K> | keyequalityComparer | The key equalitySCG.Comparer |
Methods
| Improve this Doc View SourceEquals(KeyValuePair<K, V>, KeyValuePair<K, V>)
Test two entries for equality
Declaration
public bool Equals(KeyValuePair<K, V> entry1, KeyValuePair<K, V> entry2)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<K, V> | entry1 | First entry |
KeyValuePair<K, V> | entry2 | Second entry |
Returns
Type | Description |
---|---|
System.Boolean | True if keys are equal |
GetHashCode(KeyValuePair<K, V>)
Get the hash code of the entry
Declaration
public int GetHashCode(KeyValuePair<K, V> entry)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<K, V> | entry | The entry |
Returns
Type | Description |
---|---|
System.Int32 | The hash code of the key |
Implements
System.Collections.Generic.IEqualityComparer<T>