public interface IReadOnlyList<T> extends Iterable<T>
Represents a read-only collection of elements that can be accessed by index.
T
: The type of elements in the read-only list.
Modifier and Type | Method and Description |
---|---|
boolean |
contains(T item)
Determines whether the collection contains a specific item.
|
T |
get_Item(int index)
Gets the element at the specified index in the read-only list.
|
int |
getCount()
Gets the number of elements contained in the collection.
|
int |
indexOf(T item)
Determines the index of a specific item in the collection.
|
forEach, iterator, spliterator
int getCount()
Gets the number of elements contained in the collection.
T get_Item(int index)
Gets the element at the specified index in the read-only list.
index
- The zero-based index of the element to get.int indexOf(T item)
Determines the index of a specific item in the collection.
item
- The item to locate in the collection.item
if found in the collection; otherwise, -1.boolean contains(T item)
Determines whether the collection contains a specific item.
item
- The item to locate in the collection.