Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Class: RT.Util.Collections.AutoList<T>

Summary

Encapsulates a list which dynamically grows as items are written to non-existent indexes. Any gaps are populated with default values. The behaviour of this list's indexed getter and setter is indistinguishable from that of an infinitely long list pre-populated by invoking the initializer function (assuming it is side-effect free). See Remarks.

Generic type parameters

TThis type parameter is not documented.

Remarks

Only the indexer behaviour is changed; in every other way this behaves just like a standard, non-infinite list. Moreover, the implementation is such that the new behaviour is only effective when used directly through the class; accessing the indexer through the IList interface or the List base class will currently behave the same as it would for a standard list.

Note that this is not a sparse list; accessing elements at a given index will grow the list to contain all of the items below the index too.

Constructors

AutoList<T>(Func<int, T> initializer = null)
Constructor.
AutoList<T>(int capacity, Func<int, T> initializer = null)
AutoList<T>(IEnumerable<T> collection, Func<int, T> initializer = null)

Instance methods

void
Add(T item)
  • Implements: ICollection<T>.Add(T)
Equivalent to the same method in List<T>.
void
AddRange(IEnumerable<T> item)
ReadOnlyCollection<T>
int
BinarySearch(T item)
void
  • Implements: ICollection<T>.Clear()
bool
Contains(T item)
  • Implements: ICollection<T>.Contains(T)
AutoList<TOutput>
ConvertAll<TOutput>(Converter<T, TOutput> converter)
void
CopyTo(T[] array, int arrayIndex)
  • Implements: ICollection<T>.CopyTo(T[], int)
bool
Exists(Predicate<T> match)
T
Find(Predicate<T> match)
AutoList<T>
FindAll(Predicate<T> match)
int
FindIndex(Predicate<T> match)
int
FindIndex(int startIndex, Predicate<T> match)
int
FindIndex(int startIndex, int count, Predicate<T> match)
T
FindLast(Predicate<T> match)
int
FindLastIndex(Predicate<T> match)
int
FindLastIndex(int startIndex, Predicate<T> match)
int
FindLastIndex(int startIndex, int count, Predicate<T> match)
IEnumerator<T>
  • Implements: IEnumerable<T>.GetEnumerator()
AutoList<T>
GetRange(int index, int count)
int
IndexOf(T item)
  • Implements: IList<T>.IndexOf(T)
int
IndexOf(T item, int index)
int
IndexOf(T item, int index, int count)
void
Insert(int index, T item)
  • Implements: IList<T>.Insert(int, T)
void
InsertRange(int index, IEnumerable<T> collection)
int
LastIndexOf(T item)
int
LastIndexOf(T item, int index)
int
LastIndexOf(T item, int index, int count)
bool
Remove(T item)
  • Implements: ICollection<T>.Remove(T)
int
RemoveAll(Predicate<T> match)
void
RemoveAt(int index)
  • Implements: IList<T>.RemoveAt(int)
void
RemoveRange(int index, int count)
void
void
Reverse(int index, int count)
void
void
Sort(Comparison<T> comparison)
void
Sort(IComparer<T> comparer)
void
Sort(int index, int count, IComparer<T> comparer)
T[]
void
bool
TrueForAll(Predicate<T> match)

Instance properties

intEquivalent to the same property in List<T>.
int
  • Implements: ICollection<T>.Count
bool
  • Implements: ICollection<T>.IsReadOnly
T
this[int index]
  • Implements: IList<T>.this[int]
Gets or sets the element at the specified index. The behaviour of both the getter and the setter is indistinguishable from that of an infinitely long list pre-populated by invoking the initializer function (assuming it is side-effect free).