Defines methods to support the comparison of objects for equality.
type_t, and specify that this definition be used with a collection type that accepts the xtd::collections::generic::iequality_comparer <type_t> generic interface. In the xtd framework, constructors of the xtd::collections::generic::dictionary <key_t, value_t> generic collection type accept this interface. contains, index_of, last_index_of, and remove methods of the xtd::collections::generic::dictionary <key_t, value_t> class and other generic collections. Public Methods | |
| virtual bool | equals (const type_t &x, const type_t &y) const noexcept=0 |
| Determines whether the specified objects are equal. | |
| virtual xtd::size | get_hash_code (const type_t &obj) const noexcept=0 |
| Returns a hash code for the specified object. | |
|
pure virtualnoexcept |
Determines whether the specified objects are equal.
| x | The first object of type type_t to compare. |
| y | The seco,d object of type type_t to compare. |
true if the specified objects are equal; otherwise, false. type_t. true for two objects x and y, then the value returned by the xtd::collections::generic::iequality_comparer::get_hash_code method for x must equal the value returned for y. The xtd::collections::generic::iequality_comparer::equals method is reflexive, symmetric, and transitive. That is, it returns true if used to compare an object with itself; true for two objects x and y if it is true for y and x; and true for two objects x and z if it is true for x and y and also true for y and z. Implemented in xtd::basic_string_comparer< char_t >, and xtd::collections::generic::equality_comparer< type_t >.
|
pure virtualnoexcept |
Returns a hash code for the specified object.
| obj | The xtd::object for which a hash code is to be returned. |
type_t, corresponding to the customized equality comparison provided by the xtd::collections::generic::iequality_comparer::equals method. true for two objects x and y, then the value returned by the xtd::collections::generic::iequality_comparer::get_hash_code method for x must equal the value returned for y. Implemented in xtd::basic_string_comparer< char_t >, and xtd::collections::generic::equality_comparer< type_t >.