IEqualityComparer Rozhraní
Definice
Definuje metody pro podporu porovnání objektů pro rovnost.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
- Odvozené
- Atributy
Poznámky
Toto rozhraní umožňuje implementaci přizpůsobeného porovnání rovnosti pro kolekce.This interface allows the implementation of customized equality comparison for collections. To znamená, že můžete vytvořit vlastní definici rovnosti a určit, že tato definice bude použita s typem kolekce, který přijímá IEqualityComparer rozhraní.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. V .NET Framework konstruktory Hashtable NameValueCollection OrderedDictionary typy kolekce, a přijímají toto rozhraní.In the .NET Framework, constructors of the Hashtable, NameValueCollection, and OrderedDictionary collection types accept this interface.
Obecnou verzi tohoto rozhraní naleznete v tématu System.Collections.Generic.IEqualityComparer<T> .For the generic version of this interface, see System.Collections.Generic.IEqualityComparer<T>.
IEqualityComparer
Rozhraní podporuje pouze porovnávání rovnosti.The IEqualityComparer
interface supports only equality comparisons. Přizpůsobení porovnání pro řazení a řazení je zajištěno IComparer rozhraním.Customization of comparisons for sorting and ordering is provided by the IComparer interface.
Metody
Equals(Object, Object) |
Určuje, zda jsou zadané objekty stejné.Determines whether the specified objects are equal. |
GetHashCode(Object) |
Vrátí hodnotu hash zadaného objektu.Returns a hash code for the specified object. |