public class ReadOnlyList<T> extends Object implements IReadOnlyList<T>
Provides an abstract base class for a strongly typed read-only list.
T
: The type of the element.
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 collection.
|
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.
|
Iterator<T> |
iterator()
Returns an enumerator that iterates through a collection.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public final int getCount()
Gets the number of elements contained in the collection.
getCount
in interface IReadOnlyList<T>
public final T get_Item(int index)
Gets the element at the specified index in the collection.
get_Item
in interface IReadOnlyList<T>
index
- The zero-based index of the element to get.public final boolean contains(T item)
Determines whether the collection contains a specific item.
contains
in interface IReadOnlyList<T>
item
- The item to locate in the collection.public final int indexOf(T item)
Determines the index of a specific item in the collection.
indexOf
in interface IReadOnlyList<T>
item
- The item to locate in the collection.item
if found in the collection; otherwise, -1.