Collection<T>.IList.Item[Int32] プロパティ
定義
指定したインデックスにある要素を取得または設定します。Gets or sets the element at the specified index.
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 から始まるインデックス番号。The zero-based index of the element to get or set.
プロパティ値
指定したインデックス位置にある要素。The element at the specified index.
実装
例外
プロパティが設定されていて、value
が IList に割り当てることのできない型です。The property is set and value
is of a type that is not assignable to the IList.
注釈
このプロパティは、構文 myCollection[index]
を使用して、コレクションの特定の要素にアクセスする機能を提供します。This property provides the ability to access a specific element in the collection by using the following syntax: myCollection[index]
.
C# 言語では、プロパティを実装する代わりに、 this キーワードを使用してインデクサーを定義し IList.Item[] ます。The C# language uses the this keyword to define the indexers instead of implementing the IList.Item[] property. Visual Basic は、IList.Item[] を既定のプロパティとして実装しており、同様のインデックス機能を提供します。Visual Basic implements IList.Item[] as a default property, which provides the same indexing functionality.
このプロパティの値の取得は O (1) 操作です。プロパティの設定は、O (1) 操作でもあります。Retrieving the value of this property is an O(1) operation; setting the property is also an O(1) operation.