|
Eamon CS
3.1.0
|
A sorted collection (set) data structure using b-trees. More...
Public Member Functions | |
| BTree () | |
| Initializes a new BTree instance; used by the SharpSerializer. More... | |
| BTree (int nodeCapacity=128) | |
| Initializes a new BTree instance. More... | |
| BTree (IComparer< T > comparer, int nodeCapacity=128) | |
| Initializes a new BTree instance with the specified comparer. More... | |
| T | At (int index) |
| Gets the item at the specified index. O(log N) More... | |
| bool | Contains (T value) |
| Gets a value indicating whether the specified value is in the collection. O(log N) More... | |
| bool | TryGetValue (T equalValue, out T actualValue) |
| Searches the collection for a given value and returns the equal value it finds, if any. O(log N) More... | |
| void | Add (T value) |
| Adds the specified value to the collection. O(log N) More... | |
| void | Clear () |
| Clears the collection of all elements. O(1) More... | |
| bool | Remove (T value) |
| Removes the specified key value from the collection. O(log N) More... | |
| void | RemoveAt (int index) |
| Removes the item at the specified index. O(log N) More... | |
| IEnumerator< T > | GetEnumerator () |
| Gets an enumerator for the collection. O(1), move next: O(1) More... | |
| void | CopyTo (T[] array, int arrayIndex) |
| Copies the collection into the specified array. O(N) More... | |
| int | FirstIndexWhereGreaterThan (T value) |
| Gets the index of the first item greater than the specified value. O(log N), move next: O(1) More... | |
| int | LastIndexWhereLessThan (T value) |
| Gets the index of the last item less than the specified key. O(log N), move next: O(1) More... | |
| IEnumerable< T > | WhereGreaterOrEqual (T value) |
| Get all items equal to or greater than the specified value, starting with the lowest index and moving forwards. O(log N), move next: O(1) More... | |
| IEnumerable< T > | WhereLessOrEqualBackwards (T value) |
| Get all items less than or equal to the specified value, starting with the highest index and moving backwards. O(log N), move next: O(1) More... | |
| IEnumerable< T > | ForwardFromIndex (int index) |
| Get all items starting at the index, and moving forward. O(log N), move next: O(1) More... | |
| IEnumerable< T > | BackwardFromIndex (int index) |
| Get all items starting at the index, and moving backward. O(log N), move next: O(1) More... | |
Public Attributes | |
| int | Count => _root.TotalCount |
| Gets the number of items in the collection. More... | |
Properties | |
| IComparer< T > | Comparer [get] |
| Gets the comparer used to order items in the collection. More... | |
| bool | IsReadOnly [get, set] |
| Gets or sets indication whether this collection is readonly or mutable. More... | |
| bool | AllowDuplicates [get, set] |
| Gets or sets indication whether this collection allows duplicate values. More... | |
Properties inherited from Eamon.ThirdParty.ISortedCollection< T > | |
| IComparer< T > | Comparer [get] |
| Gets the comparer used to order items in the collection. More... | |
| bool | AllowDuplicates [get] |
| Gets indication of whether the collection allows duplicate values. More... | |
A sorted collection (set) data structure using b-trees.
| T | The type of items in the collection. |
| Eamon.ThirdParty.BTree< T >.BTree | ( | ) |
Initializes a new BTree instance; used by the SharpSerializer.
| Eamon.ThirdParty.BTree< T >.BTree | ( | int | nodeCapacity = 128 | ) |
Initializes a new BTree instance.
| nodeCapacity | The node capacity. |
| Eamon.ThirdParty.BTree< T >.BTree | ( | IComparer< T > | comparer, |
| int | nodeCapacity = 128 |
||
| ) |
Initializes a new BTree instance with the specified comparer.
| comparer | |
| nodeCapacity |
| void Eamon.ThirdParty.BTree< T >.Add | ( | T | value | ) |
Adds the specified value to the collection. O(log N)
| value | The value to add. |
| T Eamon.ThirdParty.BTree< T >.At | ( | int | index | ) |
Gets the item at the specified index. O(log N)
| index | The index for the item to retrieve. |
Implements Eamon.ThirdParty.ISortedCollection< T >.
| IEnumerable<T> Eamon.ThirdParty.BTree< T >.BackwardFromIndex | ( | int | index | ) |
Get all items starting at the index, and moving backward. O(log N), move next: O(1)
Implements Eamon.ThirdParty.ISortedCollection< T >.
| void Eamon.ThirdParty.BTree< T >.Clear | ( | ) |
Clears the collection of all elements. O(1)
| bool Eamon.ThirdParty.BTree< T >.Contains | ( | T | value | ) |
Gets a value indicating whether the specified value is in the collection. O(log N)
| value | The value. |
| void Eamon.ThirdParty.BTree< T >.CopyTo | ( | T[] | array, |
| int | arrayIndex | ||
| ) |
Copies the collection into the specified array. O(N)
| array | The array into which to copy. |
| arrayIndex | The index at which to start copying. |
| int Eamon.ThirdParty.BTree< T >.FirstIndexWhereGreaterThan | ( | T | value | ) |
Gets the index of the first item greater than the specified value. O(log N), move next: O(1)
| value | The value for which to find the index. |
Implements Eamon.ThirdParty.ISortedCollection< T >.
| IEnumerable<T> Eamon.ThirdParty.BTree< T >.ForwardFromIndex | ( | int | index | ) |
Get all items starting at the index, and moving forward. O(log N), move next: O(1)
Implements Eamon.ThirdParty.ISortedCollection< T >.
| IEnumerator<T> Eamon.ThirdParty.BTree< T >.GetEnumerator | ( | ) |
Gets an enumerator for the collection. O(1), move next: O(1)
| int Eamon.ThirdParty.BTree< T >.LastIndexWhereLessThan | ( | T | value | ) |
Gets the index of the last item less than the specified key. O(log N), move next: O(1)
| value | The value for which to find the index. |
Implements Eamon.ThirdParty.ISortedCollection< T >.
| bool Eamon.ThirdParty.BTree< T >.Remove | ( | T | value | ) |
Removes the specified key value from the collection. O(log N)
| value | The key value to remove. |
| void Eamon.ThirdParty.BTree< T >.RemoveAt | ( | int | index | ) |
Removes the item at the specified index. O(log N)
| index | The index from which to remove. |
Implements Eamon.ThirdParty.ISortedCollection< T >.
| bool Eamon.ThirdParty.BTree< T >.TryGetValue | ( | T | equalValue, |
| out T | actualValue | ||
| ) |
Searches the collection for a given value and returns the equal value it finds, if any. O(log N)
| equalValue | The value of the node to search for. |
| actualValue | The value from the collection that the search found, or the default value of T when the search yielded no match. |
Implements Eamon.ThirdParty.ISortedCollection< T >.
| IEnumerable<T> Eamon.ThirdParty.BTree< T >.WhereGreaterOrEqual | ( | T | value | ) |
Get all items equal to or greater than the specified value, starting with the lowest index and moving forwards. O(log N), move next: O(1)
| value | The value. |
Implements Eamon.ThirdParty.ISortedCollection< T >.
| IEnumerable<T> Eamon.ThirdParty.BTree< T >.WhereLessOrEqualBackwards | ( | T | value | ) |
Get all items less than or equal to the specified value, starting with the highest index and moving backwards. O(log N), move next: O(1)
| value | The key value. |
Implements Eamon.ThirdParty.ISortedCollection< T >.
| int Eamon.ThirdParty.BTree< T >.Count => _root.TotalCount |
Gets the number of items in the collection.
|
getset |
Gets or sets indication whether this collection allows duplicate values.
|
get |
Gets the comparer used to order items in the collection.
|
getset |
Gets or sets indication whether this collection is readonly or mutable.