Oracle® Coherence .NET API Reference Release 3.7.1
E22844-03

Compares its two arguments for order.

Namespace:  Tangosol.Util.Comparator
Assembly:  Coherence (in Coherence.dll) Version: 3.7.1.23 (3.7.1.23)

Syntax

C#
public static int CompareSafe(
	IComparer comparer,
	Object o1,
	Object o2
)

Parameters

comparer
Type: System.Collections..::.IComparer
A comparer to use for the comparison (optional).
o1
Type: System..::.Object
The first object to be compared.
o2
Type: System..::.Object
The second object to be compared.

Return Value

A negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

Remarks

Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second. Null values are evaluated as "less then" any non-null value. Non-null values that do not implement IComparable interface will be evaluated as equal.

Exceptions

ExceptionCondition
System..::.ArgumentException If the arguments are not of the same type or do not implement IComparable.

See Also