Table of Contents

Class EntryKeyComparer<TKey, TValue>

Namespace
Garyon.Objects
Assembly
Garyon.dll

Represents a KeyValuePair<TKey, TValue> comparer, where the result only relies on the comparison result between the keys.

public sealed class EntryKeyComparer<TKey, TValue> : IKeyValuePairComparer<TKey, TValue>, IComparer<KeyValuePair<TKey, TValue>> where TKey : IComparable<TKey>

Type Parameters

TKey

The type of the key.

TValue

The type of the value.

Inheritance
EntryKeyComparer<TKey, TValue>
Implements
IKeyValuePairComparer<TKey, TValue>
IComparer<KeyValuePair<TKey, TValue>>
Inherited Members
Extension Methods

Fields

Default

The default instance of the EntryKeyComparer<TKey, TValue> class.

public static readonly EntryKeyComparer<TKey, TValue> Default

Field Value

EntryKeyComparer<TKey, TValue>

Methods

Compare(KeyValuePair<TKey, TValue>, KeyValuePair<TKey, TValue>)

Compares two KeyValuePair<TKey, TValue> instances given this comparer's rules.

public int Compare(KeyValuePair<TKey, TValue> left, KeyValuePair<TKey, TValue> right)

Parameters

left KeyValuePair<TKey, TValue>

The left value to compare.

right KeyValuePair<TKey, TValue>

The right value to compare.

Returns

int

The comparison result between the keys. For the comparison, order is matched.