Class: Comparer

Comparer(eqCompareropt)

new Comparer(eqCompareropt)

Parameters:
Name Type Attributes Description
eqComparer EqualityComparer.<T> <optional>
Optional. Defaults to EqualityComparer.default. An EqualityComparer to use for comparing two items. The method compareTo() returns 0 if the equality comparer considers the two compared items to be equal.
Source:

Members

_eqComparer :EqualityComparer.<T>

Type:
Source:

equalityComparer

Source:

equalityComparer

Source:

Methods

(protected) _validateEqualityComparer(eqComparer) → {EqualityComparer.<T>}

Parameters:
Name Type Description
eqComparer EqualityComparer.<T> The comparer
Source:
Throws:
If the given value is not of type EqualityComparer.
Type
Error
Returns:
The same comparer that was given
Type
EqualityComparer.<T>

compare(x, y) → {Number}

Compare two items and return a value that indicates which of them is considered to be less or smaller. A negative value means that x is smaller than y; 0 means they are equally large and a positive value means that y is larger than x.
Parameters:
Name Type Description
x T
y T
Source:
Returns:
Returns either -1, 0 or 1.
Type
Number