Class Array<T>
Contiguous fixed-sized data structure.
Inheritance
Implements
Namespace: Towel.DataStructures
Assembly: Towel.dll
Syntax
public class Array<T> : object, IArray<T>, IArray<T, int>, IDataStructure<T>, ISteppable<T>, System.Collections.Generic.IEnumerable<T>, ICloneable<Array<T>>
Type Parameters
Name | Description |
---|---|
T | The generic type within the structure. |
Constructors
| Improve this Doc View SourceArray(T[])
Constructs by wrapping an existing array.
Declaration
public Array(params T[] array)
Parameters
Type | Name | Description |
---|---|---|
T[] | array | The array to be wrapped. |
Array(Int32)
Constructs an array that implements a traversal delegate function which is an optimized "foreach" implementation.
Declaration
public Array(int size)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | size | The length of the array in memory. |
Properties
| Improve this Doc View SourceItem[Int32]
Allows indexed access of the array.
Declaration
public T this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Property Value
Type | Description |
---|---|
T | The value at the desired index. |
Length
The length of the array.
Declaration
public int Length { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceClone()
Clones a T
.
Declaration
public Array<T> Clone()
Returns
Type | Description |
---|---|
Array<T> | A clone of the |
GetEnumerator()
Declaration
public System.Collections.Generic.IEnumerator<T> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<T> |
StepperBreak<TStep>(TStep)
Traverses values and invokes a function on every T
value.
Declaration
public StepStatus StepperBreak<TStep>(TStep step)
where TStep : struct, IFunc<T, StepStatus>
Parameters
Type | Name | Description |
---|---|---|
TStep | step | The function to invoke on every |
Returns
Type | Description |
---|---|
StepStatus | The status of the traversal. |
Type Parameters
Name | Description |
---|---|
TStep | The type of function to invoke on every |
ToArray()
Constructs an array with the values of this data structure.
Declaration
public T[] ToArray()
Returns
Type | Description |
---|---|
T[] | An array with the values of this data structure. |
Operators
| Improve this Doc View SourceImplicit(T[] to Array<T>)
Implicitly converts a C# System array into a Towel array.
Declaration
public static implicit operator Array<T>(T[] array)
Parameters
Type | Name | Description |
---|---|---|
T[] | array | The array to be represented as a Towel array. |
Returns
Type | Description |
---|---|
Array<T> |
Implicit(Array<T> to T[])
Implicitly converts a Towel array into a C# System array.
Declaration
public static implicit operator T[](Array<T> array)
Parameters
Type | Name | Description |
---|---|---|
Array<T> | array | The array to be represented as a C# System array. |
Returns
Type | Description |
---|---|
T[] |