Class KeyValuePairComparer<K, V>
Default comparer for dictionary entries in a sorted dictionary. Entry comparisons only look at keys and uses an externally defined comparer for that.
Inheritance
System.Object
KeyValuePairComparer<K, V>
Implements
System.Collections.Generic.IComparer<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 class KeyValuePairComparer<K, V> : IComparer<KeyValuePair<K, V>>
Type Parameters
Name | Description |
---|---|
K | |
V |
Constructors
| Improve this Doc View SourceKeyValuePairComparer(IComparer<K>)
Create an entry comparer for a item comparer of the keys
Declaration
public KeyValuePairComparer(IComparer<K> comparer)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IComparer<K> | comparer | Comparer of keys |
Methods
| Improve this Doc View SourceCompare(KeyValuePair<K, V>, KeyValuePair<K, V>)
Compare two entries
Declaration
public int Compare(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.Int32 | The result of comparing the keys |
Implements
System.Collections.Generic.IComparer<T>