Hashtable.KeyEquals(Object, Object) 方法
定义
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
参数
返回
如果 item 和 key 相等,则为 true;否则为 false。true if item and key are equal; otherwise, false.
例外
注解
如果哈希表是使用特定实现创建的 IComparer ,则此方法将使用该比较器,即 Compare (item , key) 。If the hash table was created with a specific IComparer implementation, this method uses that comparer; that is, Compare (item, key). 否则,它使用 item.Equals(key) 。Otherwise, it uses item.Equals(key).
此方法是一种 O(1) 操作。This method is an O(1) operation.