Class ReadOnlyList<T>
A faster alternative to ReadOnlyCollection<T> which allows calls to the underlying list to be inlined.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Collections
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
public class ReadOnlyList<T> : IEnumerable<T>, IEnumerable
Type Parameters
| Name | Description |
|---|---|
| T | The type of a list element. |
Constructors
ReadOnlyList(List<T>)
Initializes a new instance of the ReadOnlyList<T> class.
Declaration
public ReadOnlyList(List<T> list)
Parameters
| Type | Name | Description |
|---|---|---|
| List<T> | list | The wrapped list. |
Properties
Count
Gets the number of elements in the list.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Item[Int32]
Gets the element with a specified index form the list.
Declaration
public T this[int index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | index | The element index. |
Property Value
| Type | Description |
|---|---|
| T | The element with the given index. |
Methods
GetEnumerator()
Returns an enumerator that iterates through the list.
Declaration
public IEnumerator<T> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<T> | An enumerator that iterates through the list. |
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Returns an enumerator that iterates through the list.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator | An enumerator that iterates through the list. |