Table of Contents

Struct SubArrayList<T>

A class that simulates very minimal features of a List, but using a SubArray<T> instead of an Array as a storage

public struct SubArrayList<T>

Type Parameters

T
A class that simulates very minimal features of a List, but using a instead of an as a storage

Constructors

SubArrayList(int, ArrayPool<T>)

Creates an instance

public SubArrayList(int initialCapacity, ArrayPool<T> typePool)

Parameters

initialCapacity int

The initial capacity of the underlying storage

typePool ArrayPool<T>

A pool that will be used to, if needed, allocate a bigger array if elements

Properties

Array

The Array used by the underlying SubArray<T> for storage

public T[] Array { get; }

Property Value

T[]

Count

The number of elements occupied in the storage

public readonly int Count { get; }

Property Value

int

Methods

Add(T)

Adds a new element to the array

public void Add(T element)

Parameters

element T

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(SubArrayList<T>)

public bool Equals(SubArrayList<T> other)

Parameters

other SubArrayList<T>

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToSubArray()

Returns a SubArray<T> instance that will have Array as an array (not a copy of it), and Count as its Count

public SubArray<T> ToSubArray()

Returns

SubArray<T>

Operators

operator ==(SubArrayList<T>, SubArrayList<T>)

public static bool operator ==(SubArrayList<T> a, SubArrayList<T> b)

Parameters

a SubArrayList<T>
b SubArrayList<T>

Returns

bool

operator !=(SubArrayList<T>, SubArrayList<T>)

public static bool operator !=(SubArrayList<T> a, SubArrayList<T> b)

Parameters

a SubArrayList<T>
b SubArrayList<T>

Returns

bool

See Also