Collection<T>.IList.Item[Int32] プロパティ

定義

指定したインデックスにある要素を取得または設定します。

property System::Object ^ System::Collections::IList::Item[int] { System::Object ^ get(int index); void set(int index, System::Object ^ value); };
object System.Collections.IList.Item[int index] { get; set; }
object? System.Collections.IList.Item[int index] { get; set; }
member this.System.Collections.IList.Item(int) : obj with get, set
 Property Item(index As Integer) As Object Implements IList.Item

パラメーター

index
Int32

取得または設定する要素の、0 から始まるインデックス番号。

プロパティ値

Object

指定したインデックス位置にある要素。

実装

例外

indexIList の有効なインデックスではありません。

プロパティが設定されていて、valueIList に割り当てることのできない型です。

注釈

このプロパティは、構文 myCollection[index] を使用して、コレクションの特定の要素にアクセスする機能を提供します。

C# 言語では、プロパティを実装する代わりに 、この キーワードを使用してインデクサーを IList.Item[] 定義します。 Visual Basic は、IList.Item[] を既定のプロパティとして実装しており、同様のインデックス機能を提供します。

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

適用対象