ImmutableArray<T> Class

Represents an array that is immutable; meaning it cannot be changed once it is created.

C#
public sealed class ImmutableArray<T> : IReadOnlyList<T>

Type Parameters

T

The type of elements stored in the array.

Inheritance
ImmutableArray<T>
Implements

Constructors

ImmutableArray(T[])

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

GetEnumerator()

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.GetEnumerator()

Returns an enumerator that iterates through the collection.

Constructors Detail

ImmutableArray(T[])

Initializes a new instance of the ImmutableArray<T> class.

C#
public ImmutableArray(T[] args)

Parameters

args
T[]

The array to be copied.

Properties Detail

Count

Gets the number of elements in the collection.

C#
public int Count { get; }

Property Value

int

The number of elements in the collection.

Implements

this[int]

Gets the element at the specified index in the read-only list.

C#
public T this[int index] { get; }

Property Value

T

The element at the specified index in the read-only list.

Implements

Methods Detail

GetEnumerator()

Returns an enumerator that iterates through the collection.

C#
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.

C#
private IEnumerator IEnumerable.GetEnumerator()

Returns

An enumerator that can be used to iterate through the collection.

Implements