ImmutableArray<T> Class
Represents an array that is immutable; meaning it cannot be changed once it is created.
public sealed class ImmutableArray<T> : IReadOnlyList<T>
Type Parameters
- T
The type of elements stored in the array.
- Inheritance
-
Immutable
Array<T>
- Implements
Constructors
Immutable |
Initializes a new instance of the ImmutableArray<T> class. |
Properties
Count |
Gets the number of elements in the collection. |
this[int] |
Gets the element at the specified index in the read-only list. |
Methods
Get |
Returns an enumerator that iterates through the collection. |
Equals(object) | (Inherited from object) |
GetHashCode() | (Inherited from object) |
GetType() | (Inherited from object) |
MemberwiseClone() | (Inherited from object) |
ToString() | (Inherited from object) |
Explicit Interface Implementations
IEnumerable.Get |
Returns an enumerator that iterates through the collection. |
Constructors Detail
ImmutableArray(T[])
Initializes a new instance of the ImmutableArray<T> class.
public ImmutableArray(T[] args)
Parameters
- args
- T[]
The array to be copied.
Properties Detail
Count
Gets the number of elements in the collection.
public int Count { get; }
Property Value
The number of elements in the collection.
Implements
this[int]
Gets the element at the specified index in the read-only list.
public T this[int index] { get; }
Property Value
The element at the specified index in the read-only list.
Implements
Methods Detail
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<T> GetEnumerator()
Returns
An enumerator that can be used to iterate through the collection.
Implements
Explicit Interface Implementations Detail
IEnumerable.GetEnumerator()
Returns an enumerator that iterates through the collection.
private IEnumerator IEnumerable.GetEnumerator()
Returns
An enumerator that can be used to iterate through the collection.