Class ReadOnlyArray
Provides methods for creating read-only arrays.
Inheritance
System.Object
ReadOnlyArray
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ItsyBitsy.Collections
Assembly: ItsyBitsy.Collections.ReadOnlyArray.dll
Syntax
public static class ReadOnlyArray
Methods
| Improve this Doc View SourceCreateImmutable<T>(ReadOnlyArray<T>, Int32, Int32)
Creates an immutable array that contains the specified elements from a read-only array.
Declaration
public static ImmutableArray<T> CreateImmutable<T>(ReadOnlyArray<T> items, int start, int length)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlyArray<T> | items | The source array. |
System.Int32 | start | The index of the first element to copy from
items . |
System.Int32 | length | The number of elements to copy from items .
|
Returns
Type | Description |
---|---|
System.Collections.Immutable.ImmutableArray<T> | An immutable array that contains the specified elements from the source array. |
Type Parameters
Name | Description |
---|---|
T | The type of the elements in the array. |
CreateImmutable<T>(ReadOnlySpan<T>)
Creates an immutable array that contains the specified elements from a read-only span.
Declaration
public static ImmutableArray<T> CreateImmutable<T>(ReadOnlySpan<T> items)
Parameters
Type | Name | Description |
---|---|---|
System.ReadOnlySpan<T> | items | The source span. |
Returns
Type | Description |
---|---|
System.Collections.Immutable.ImmutableArray<T> | An immutable array that contains the specified elements from the source span. |
Type Parameters
Name | Description |
---|---|
T | The type of the elements in the array. |
FromArray<T>(T[])
Converts an array to a ReadOnlyArray<T>.
Declaration
public static ReadOnlyArray<T> FromArray<T>(T[] array)
Parameters
Type | Name | Description |
---|---|---|
T[] | array |
Returns
Type | Description |
---|---|
ReadOnlyArray<T> |
Type Parameters
Name | Description |
---|---|
T |
FromImmutableArray<T>(ImmutableArray<T>)
Converts an System.Collections.Immutable.ImmutableArray<T> to a ReadOnlyArray<T>.
Declaration
public static ReadOnlyArray<T> FromImmutableArray<T>(ImmutableArray<T> array)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Immutable.ImmutableArray<T> | array |
Returns
Type | Description |
---|---|
ReadOnlyArray<T> |
Type Parameters
Name | Description |
---|---|
T |