Dictionary<TKey,TValue>.Count プロパティ

定義

Dictionary<TKey,TValue> に格納されているキー/値ペアの数を取得します。

public:
 property int Count { int get(); };
public int Count { get; }
member this.Count : int
Public ReadOnly Property Count As Integer

プロパティ値

Int32

Dictionary<TKey,TValue> に格納されているキー/値ペアの数。

実装

注釈

a Dictionary<TKey,TValue> の容量は、格納できる要素 Dictionary<TKey,TValue> の数です。 Countこのプロパティは、実際Dictionary<TKey,TValue>に .

容量は常に Count 以上です。 要素を追加するときに Count が容量を上回る場合、容量は、古い要素をコピーして新しい要素を追加する前に、内部配列を自動的に再割り当てすることによって増加します。

このプロパティの値の取得は O(1) 操作です。

適用対象