WList is the mutable variant of the VList data structure.
An article is available online about the VList data types.
See the remarks of VListBlock<T> for more information about VLists and WLists. It is most efficient to add items to the front of a FWList (at index 0) or the back of an WList (at index Count-1).
|
| WList (T itemZero, T itemOne) |
|
| WList (IEnumerable< T > list) |
|
void | AddRange (IEnumerable< T > items) |
|
new void | AddRange (IEnumerator< T > items) |
|
void | AddRange (IReadOnlyList< T > list) |
|
void | InsertRange (int index, IReadOnlyList< T > list) |
|
void | RemoveRange (int index, int count) |
|
new void | Insert (int index, T item) |
|
new void | RemoveAt (int index) |
|
new VList< T >.Enumerator | GetEnumerator () |
|
FVList< T >.Enumerator | ReverseEnumerator () |
|
new T | TryGet (int index, out bool fail) |
|
WList< T > | Clone () |
|
WList< T > | Where (Func< T, bool > filter) |
| Applies a filter to a list, to exclude zero or more items. More...
|
|
WList< T > | WhereSelect (Func< T, Maybe< T >> filter) |
| Filters and maps a list with a user-defined function. More...
|
|
WList< T > | SmartSelect (Func< T, T > map) |
| Maps a list to another list of the same length. More...
|
|
WList< T > | Transform (VListTransformer< T > x) |
| Transforms a list (combines filtering with selection and more). More...
|
|
T | Pop () |
| Removes the back item (at index Count-1) from the list and returns it. More...
|
|
VList< T > | WithoutLast (int numToRemove) |
|
FWList< T > | ToFWList () |
| Returns this list as a FWList, which effectively reverses the order of the elements. More...
|
|
T[] | ToArray () |
| Returns the WList converted to an array. More...
|
|
void | Resize (int newSize) |
| Resizes the list to the specified size. More...
|
|
new void | Add (T item) |
|
new void | Clear () |
|
new void | Insert (int index, T item) |
|
new void | RemoveAt (int index) |
|
new int | IndexOf (T item) |
|
new bool | Contains (T item) |
|
new void | CopyTo (T[] array, int arrayIndex) |
| Copies the elements of the collection to an Array, starting at a particular array index. More...
|
|
new bool | Remove (T item) |
|
IEnumerator< T > | GetEnumerator () |
|
T | TryGet (int index, out bool fail) |
|
Slice_< T > | Slice (int start, int count) |
|
void | Push (T item) |
| Synonym for Add(); adds an item to the front of the list. More...
|
|
new FVList< T > | ToFVList () |
|
new VList< T > | ToVList () |
|
IRange< T > | Slice (int start, int count=int.MaxValue) |
| Returns a sub-range of this list. More...
|
|
bool | Contains (T item) |
| Returns true if and only if the collection contains the specified item. More...
|
|
|
override int | AdjustWListIndex (int index, int size) |
| This method implements the difference between FWList and WList: In FWList it returns index , but in WList it returns Count-size-index . More...
|
|
override IEnumerator< T > | GetIEnumerator () |
|
| WListProtected (WListProtected< T > original, bool takeOwnership) |
|
T | GetAt (int index) |
| Gets an item from a FWList or WList at the specified index. More...
|
|
void | SetAt (int index, T value) |
| Sets an item in a FWList or WList at the specified index. More...
|
|
void | Add (T item) |
| Inserts an item at the "front" of the list, which is index 0 for FWList, or Count for WList. More...
|
|
void | Insert (int index, T item) |
|
void | RemoveAt (int index) |
|
int | IndexOf (T item) |
| Searches for the specified object and returns the zero-based index of the first occurrence (lowest index) within the entire FVList. More...
|
|
bool | Contains (T item) |
|
void | CopyTo (T[] array, int arrayIndex) |
|
bool | Remove (T item) |
|
FVList< T >.Enumerator | GetVListEnumerator () |
|
VList< T >.Enumerator | GetRVListEnumerator () |
|
void | RemoveAtDff (int distanceFromFront) |
|
void | RemoveRangeBase (int distanceFromFront, int count) |
|
void | InsertRangeAtDff (int distanceFromFront, IReadOnlyList< T > items, bool isRWList) |
|
void | InsertAtDff (int distanceFromFront, T item) |
|
T | GetAtDff (int distanceFromFront) |
| Gets an item WITHOUT doing a range check More...
|
|
void | SetAtDff (int distanceFromFront, T item) |
| Sets an item WITHOUT doing a range or mutability check More...
|
|
FVList< T > | ToFVList () |
| Returns this list as a FVList; if this is a WList, the order of the elements is reversed at the same time. More...
|
|
VList< T > | ToVList () |
| Returns this list as a VList; if this is a FWList, the order of the elements is reversed at the same time. More...
|
|
Resizes the list to the specified size.
If the new size is larger than the old size, empty elements are added to the end. If the new size is smaller, elements are truncated from the end.
I decided not to offer a Resize() method for the FWList because the natural place to insert or remove items in a FWList is at the beginning. For a Resize() method to do so, I felt, would come as too much of a surprise to some programmers.