Hashtable.KeyEquals(Object, Object) Método

Definición

Compara un Object específico con una clave concreta en Hashtable.Compares a specific Object with a specific key in the Hashtable.

protected:
 virtual bool KeyEquals(System::Object ^ item, System::Object ^ key);
protected virtual bool KeyEquals (object item, object key);
protected virtual bool KeyEquals (object? item, object key);
abstract member KeyEquals : obj * obj -> bool
override this.KeyEquals : obj * obj -> bool
Protected Overridable Function KeyEquals (item As Object, key As Object) As Boolean

Parámetros

item
Object

Object que se va a comparar con key.The Object to compare with key.

key
Object

Clave de Hashtable que se va a comparar con item.The key in the Hashtable to compare with item.

Devoluciones

Boolean

true si item y key son iguales; en caso contrario, false.true if item and key are equal; otherwise, false.

Excepciones

item es null.item is null.

O bien-or- key es null.key is null.

Comentarios

Si la tabla hash se creó con una IComparer implementación concreta, este método utiliza ese comparador; es decir, Compare ( item , key ).If the hash table was created with a specific IComparer implementation, this method uses that comparer; that is, Compare (item, key). De lo contrario, utiliza item.Equals(key) .Otherwise, it uses item.Equals(key).

Este método es una O(1) operación.This method is an O(1) operation.

Se aplica a

Consulte también