Enhanced C#
Language of your choice: library documentation
Public Member Functions | List of all members
Loyc.Collections.INegAutoSizeArray< T > Interface Template Reference

An auto-sizing array is a list structure that allows you to modify the element at any index, including indexes that don't yet exist; the collection automatically adds missing indexes. More...


Source file:
Inheritance diagram for Loyc.Collections.INegAutoSizeArray< T >:
Loyc.Collections.INegArray< T > Loyc.Collections.INegListSource< T >

Remarks

An auto-sizing array is a list structure that allows you to modify the element at any index, including indexes that don't yet exist; the collection automatically adds missing indexes.

Template Parameters
TData type of each element.

This interface allows negative indexes, unlike IAutoSizeArray<T>.

Public Member Functions

void Optimize ()
 Optimizes the data structure to consume less memory or storage space. More...
 
- Public Member Functions inherited from Loyc.Collections.INegArray< T >
bool TrySet (int index, T value)
 
- Public Member Functions inherited from Loyc.Collections.INegListSource< 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.INegArray< T >
new T this[int index] [get, set]
 Gets or sets an element of the array-like collection. More...
 
- Properties inherited from Loyc.Collections.INegListSource< T >
int Min [get]
 Returns the minimum valid index in the collection. More...
 
int Max [get]
 Returns the maximum valid index in the collection. More...
 
this[int index] [get]
 Gets the item at the specified index. More...
 

Member Function Documentation

Optimizes the data structure to consume less memory or storage space.

A simple auto-sizing array can implement this method by examining the elements with the most positive and most negative indexes, and removing any that are equal to default(T).