IEqualityComparer Interface
Definição
Define métodos para dar suporte à comparação de objetos para igualdade.Defines methods to support the comparison of objects for equality.
public interface class IEqualityComparer
public interface IEqualityComparer
[System.Runtime.InteropServices.ComVisible(true)]
public interface IEqualityComparer
type IEqualityComparer = interface
[<System.Runtime.InteropServices.ComVisible(true)>]
type IEqualityComparer = interface
Public Interface IEqualityComparer
- Derivado
- Atributos
Comentários
Essa interface permite a implementação de comparação de igualdade Personalizada para coleções.This interface allows the implementation of customized equality comparison for collections. Ou seja, você pode criar sua própria definição de igualdade e especificar que essa definição seja usada com um tipo de coleção que aceita a IEqualityComparer interface.That is, you can create your own definition of equality, and specify that this definition be used with a collection type that accepts the IEqualityComparer interface. Na .NET Framework, os construtores dos tipos de Hashtable NameValueCollection coleção, e OrderedDictionary aceitam essa interface.In the .NET Framework, constructors of the Hashtable, NameValueCollection, and OrderedDictionary collection types accept this interface.
Para obter a versão genérica desta interface, consulte System.Collections.Generic.IEqualityComparer<T> .For the generic version of this interface, see System.Collections.Generic.IEqualityComparer<T>.
A IEqualityComparer
interface dá suporte apenas a comparações de igualdade.The IEqualityComparer
interface supports only equality comparisons. A personalização de comparações para classificação e ordenação é fornecida pela IComparer interface.Customization of comparisons for sorting and ordering is provided by the IComparer interface.
Métodos
Equals(Object, Object) |
Determina se os objetos especificados são iguais.Determines whether the specified objects are equal. |
GetHashCode(Object) |
Retorna um código hash para o objeto especificado.Returns a hash code for the specified object. |