Common base class of AList{T} and SparseAList{T}. Most of the functionality of the two types is identical, so this class is used to share code between them.
More...
Common base class of AList{T} and SparseAList{T}. Most of the functionality of the two types is identical, so this class is used to share code between them.
This class exists for code sharing only. Clients should ignore it.
The difference between AListBase{K,T} and AListBase{T} is that the first one is the base class of all data structures in the A-List family (including BList{T}, BDictionary{K,V}, etc.) while the second one is only the base class of non-organized ALists (AList{T} and SparseAList{T}).
|
| AListBase (int maxLeafSize) |
|
| AListBase (int maxLeafSize, int maxInnerSize) |
|
| AListBase (AListBase< T > items, bool keepListChangingHandlers) |
|
abstract void | Add (T item) |
|
abstract void | Insert (int index, T item) |
|
abstract void | InsertRange (int index, IListSource< T > source) |
|
abstract bool | TrySet (int index, T value) |
|
abstract void | InsertRange (int index, IEnumerable< T > list) |
|
void | AddRange (IListSource< T > source) |
|
void | AddRange (AList< T > source) |
|
void | Resize (int newSize) |
|
virtual int | IndexOf (T item) |
| Finds an index of an item in the list. More...
|
|
bool | Contains (T item) |
| Returns true if-and-only-if the specified item exists in the list. More...
|
|
bool | Remove (T item) |
| Finds a specific item and removes it. If duplicates of the item exist, only the first occurrence is removed. More...
|
|
AListBase< T > | Clone () |
|
AListBase< T > | RemoveSection (int start, int count) |
|
new ListSlice< T > | Slice (int start, int length) |
| Returns a sub-range of this list. More...
|
|
void | RemoveAt (int index) |
|
void | RemoveRange (int index, int amount) |
|
int | RemoveAll (Predicate< T > match) |
| Removes all the elements that match the conditions defined by the specified predicate. More...
|
|
virtual void | Clear () |
|
IEnumerable< int > | IndexesOf (T item) |
| Returns a sequence of integers that represent the locations where a given item appears in the list. More...
|
|
virtual IEnumerable< int > | IndexesOf (T item, int minIndex, int maxIndex) |
|
int | LinearScanFor (T item, int startIndex, EqualityComparer< T > comparer) |
| Scans the list starting at startIndex and going upward, and returns the index of an item that matches the first argument. More...
|
|
void | CopyTo (T[] array, int arrayIndex) |
|
Enumerator | GetEnumerator () |
|
Enumerator | GetEnumerator (int startIndex) |
|
Enumerator | GetEnumerator (int start, int subcount) |
|
Enumerator | GetEnumerator (int start, int subcount, bool startAtEnd) |
|
T | TryGet (int index, out bool fail) |
| Gets the item at the specified index, and does not throw an exception on failure. More...
|
|
virtual void | Freeze () |
| Prevents further changes to the list. More...
|
|
Slice_< T > | Slice (int start, int length) |
| Returns a sub-range of this list. More...
|
|
int | GetImmutableCount () |
| Diagnostic method. Returns the number of elements of the list that are located in immutable nodes, which will be copied if modified. Used by the test suite. More...
|
|
virtual bool | AddObserver (IAListTreeObserver< K, T > observer) |
| Attaches a tree observer to this object. More...
|
|
virtual bool | RemoveObserver (IAListTreeObserver< K, T > observer) |
| Removes a previously attached tree observer from this list. More...
|
|
|
| AListBase (AListBase< int, T > original, AListNode< int, T > section) |
|
override AListInnerBase< int, T > | SplitRoot (AListNode< int, T > left, AListNode< int, T > right) |
|
void | DetectSizeOverflow (int insertSize) |
| Throws OverflowException if inserting the specified number of items would cause Count to overflow. More...
|
|
void | BeginInsertRange (int index, IListSource< T > items, int itemsCount) |
|
void | DoneInsertRange (int amountInserted) |
|
void | InsertRange (int index, AListBase< T > source, bool move) |
|
abstract void | Clone (out AListBase< T > clone) |
|
abstract AListBase< T > | cov_RemoveSection (int start, int count) |
|
virtual void | Combine (AListBase< T > other, bool move, bool append) |
|
| AListBase (int maxLeafSize) |
|
| AListBase (int maxLeafSize, int maxInnerSize) |
|
| AListBase (AListBase< K, T > items, bool keepListChangingHandlers) |
| Cloning constructor. Does not duplicate the observer (IAListTreeObserver{K,T}), if any, because it may not be cloneable. More...
|
|
| AListBase (AListBase< K, T > original, AListNode< K, T > section) |
| This is the constructor that CopySection(), which can be defined by derived classes, should call to create a sublist of a list. Used in conjunction with CopySectionHelper(). More...
|
|
abstract AListNode< K, T > | NewRootLeaf () |
|
abstract AListInnerBase< K, T > | SplitRoot (AListNode< K, T > left, AListNode< K, T > right) |
|
virtual Enumerator | NewEnumerator (uint start, uint firstIndex, uint lastIndex) |
|
void | CheckPoint () |
|
void | AutoThrow () |
|
void | AutoCreateOrCloneRoot () |
|
void | AutoSplit (AListNode< K, T > splitLeft, AListNode< K, T > splitRight) |
|
void | HandleChangedOrUndersizedRoot (AListNode< K, T > result) |
|
virtual void | ClearInternal (bool forceClear) |
| Clears the tree. More...
|
|
AListNode< K, T > | CopySectionHelper (int start, int subcount) |
| Together with the AListBase{K,T}.AListBase(AListBase{K,T},AListNode{K,T}) constructor, this method helps implement the CopySection() method in derived classes, by cloning a section of the tree. More...
|
|
AListNode< K, T > | CopySectionHelper (uint start, uint subcount) |
|
void | SwapHelper (AListBase< K, T > other, bool swapObservers) |
| Swaps two ALists. More...
|
|
new ListSlice<T> Loyc.Collections.AListBase< T >.Slice |
( |
int |
start, |
|
|
int |
count |
|
) |
| |
|
inline |
Returns a sub-range of this list.
- Parameters
-
start | The new range will start at this index in the current list (this location will be index [0] in the new range). |
count | The desired number of elements in the new range, or int.MaxValue to get all elements until the end of the list. |
- Returns
- Returns a sub-range of this range.
- Exceptions
-
ArgumentException | The start index was below zero. |
The (start, count) range is allowed to be invalid, as long as start is zero or above.
-
If count is below zero, or if start is above the original Count, the Count of the new slice is set to zero.
-
if (start + count) is above the original Count, the Count of the new slice is reduced to
this.Count - start
. Implementation note: do not compute (start + count) because it may overflow. Instead, test whether (count > this.Count - start).
Most collections should use the following implementation:
IRange<T> IListSource<T>.Slice(int start, int count) { return Slice(start, count); }
public Slice_<T> Slice(int start, int count) { return new Slice_<T>(this, start, count); }
Implements Loyc.Collections.IListSource< out T >.