IEqualityComparer: Equals

Equals

Determines whether the specified values are equal.



 Public Function Equals(
	  ByRef x As Variant,
	  ByRef y As Variant ) As Boolean

Parameters

x
[ByRef] Variant. The first value to compare.
y
[ByRef] Variant. The second value to compare.

Return Values

Boolean -  True if the specified objects are equal; otherwise, False.

Remarks

Implement this method to provide a customized equality comparison for values.

Notes to Implementers

The Equals method is reflexive, symmetric, and transitive. That is, it returns True if used to compare a value with itself; True for two values x and y if it is True for y and x; and True for two values x and z if it is True for x and y and also True for y and z.

Implementations are required to ensure that if the Equals method returns true for two values x and y, then the value returned by the GetHashCode method for x must equal the value returned for y.

Exceptions

Exception Condition
ArgumentExceptionx and y are of different types and neither one can handle comparisons with the other.

See Also

Project CorLib Overview

Class IEqualityComparer Overview