Enhanced C#
Language of your choice: library documentation
|
An auto-sizing array is a list structure that allows you to modify the element at any index, including indices that don't yet exist; the collection automatically adds missing indices. More...
An auto-sizing array is a list structure that allows you to modify the element at any index, including indices that don't yet exist; the collection automatically adds missing indices.
T | Data type of each element. |
This interface begins counting elements at index zero. The INegAutoSizeArray{T} interface supports negative indexes.
Although it is legal to set this[i]
for any i >= 0
(as long as there is enough memory available for required array), this[i]
may still throw ArgumentOutOfRangeException when the index is not yet valid. However, implementations can choose not to throw an exception and return default(T)
instead.
Public Member Functions | |
void | Optimize () |
Optimizes the data structure to consume less memory or storage space. More... | |
Public Member Functions inherited from Loyc.Collections.IArray< T > | |
bool | TrySet (int index, T value) |
Public Member Functions inherited from Loyc.Collections.IListSource< out T > | |
T | TryGet (int index, out bool fail) |
Gets the item at the specified index, and does not throw an exception on failure. More... | |
IRange< T > | Slice (int start, int count=int.MaxValue) |
Returns a sub-range of this list. More... | |
Additional Inherited Members | |
Properties inherited from Loyc.Collections.IArray< T > | |
new T | this[int index] [get, set] |
Gets or sets an element of the array-like collection. More... | |
Properties inherited from Loyc.Collections.ISinkArray< T > | |
T | this[int index] [set] |
void Loyc.Collections.IAutoSizeArray< T >.Optimize | ( | ) |
Optimizes the data structure to consume less memory or storage space.
A simple auto-sizing array can implement this method by examining the final elements and removing any that are equal to default(T).