次の方法で共有


SortedList.Capacity プロパティ

SortedList の容量を取得または設定します。

Public Overridable Property Capacity As Integer
[C#]
public virtual int Capacity {get; set;}
[C++]
public: __property virtual int get_Capacity();public: __property virtual void set_Capacity(int);
[JScript]
public function get Capacity() : int;public function set Capacity(int);

プロパティ値

SortedList に格納できる要素の数。

例外

例外の種類 条件
ArgumentOutOfRangeException 代入された値が、 SortedList 内の現在の要素の数未満です。

解説

リストに追加された要素の数が現在の容量に達した場合、容量は自動的に 2 倍になります。

Capacity を設定すると、新しい容量が有効になるように、内部配列が再割り当てされます。

TrimToSize を使用して、 SortedList の容量を減らすこともできます。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

SortedList クラス | SortedList メンバ | System.Collections 名前空間 | TrimToSize