Dictionary<TKey,TValue>.KeyCollection.ICollection<TKey>.Contains メソッド

定義

ICollection<T>に特定の値が含まれているかどうかを判断します。

 virtual bool System.Collections.Generic.ICollection<TKey>.Contains(TKey item) = System::Collections::Generic::ICollection<TKey>::Contains;
bool ICollection<TKey>.Contains(TKey item);
abstract member System.Collections.Generic.ICollection<TKey>.Contains : 'Key -> bool
override this.System.Collections.Generic.ICollection<TKey>.Contains : 'Key -> bool
Function Contains (item As TKey) As Boolean Implements ICollection(Of TKey).Contains

パラメーター

item
TKey

ICollection<T>内で検索するオブジェクト。

返品

true itemICollection<T>で見つかった場合は。それ以外の場合はfalse

実装

注釈

実装は、オブジェクトの等価性を決定する方法によって異なる場合があります。たとえば、 List<T>Defaultを使用しますが、 Dictionary<TKey,TValue> では、キーの比較に使用する IComparer<T> 実装を指定できます。

このメソッドは O(1) 操作です。

適用対象