Interfaces overview

ICollection<T>, ICollectionValue<T>, IComparer<T>, IDictionary<K,V>, IDirectedCollectionValue<T>, IDirectedEnumerable<T>, IExtensible<T>, IHasher<T>, IIndexed<T>, IIndexedSorted<T>, IList<T>, IPersistentSorted<T>, IPriorityQueue<T>, IQueue<T>, ISequenced<T>, ISorted<T>, ISortedDictionary<K,V>, IStack<T>

Classes overview

ArrayBase<T>, ArrayList<T>, C5Random, CollectionBase<T>, CollectionValueBase<T>, ComparerBuilder.FromComparable<T>, DefaultReferenceTypeHasher<T>, DefaultValueTypeHasher<T>, DictionaryBase<K,V>, EnumerableBase<T>, GuardedCollection<T>, GuardedCollectionValue<T>, GuardedDictionary<K,V>, GuardedDirectedCollectionValue<T>, GuardedDirectedEnumerable<T>, GuardedEnumerable<T>, GuardedEnumerator<T>, GuardedIndexedSorted<T>, GuardedList<T>, GuardedSequenced<T>, GuardedSorted<T>, GuardedSortedDictionary<K,V>, HashBag<T>, HashDictionary<K,V>, HashedArrayList<T>, HashedLinkedList<T>, HasherBuilder.ByInvoke<T>, HasherBuilder.ByPrototype<T>, HasherBuilder.ByRTCG, HasherBuilder.SequencedHasher<S,W>, HasherBuilder.UnsequencedHasher<S,W>, HashSet<T>, IntervalHeap<T>, IntHasher, KeyValuePairComparer<K,V>, KeyValuePairHasher<K,V>, LinkedList<T>, NaturalComparer<T>, NaturalComparerO<T>, SequencedBase<T>, SortedArray<T>, Sorting, TestedAttribute, TreeBag<T>, TreeBag<T>.Enumerator, TreeBag<T>.Range.Enumerator, TreeBag<T>.SnapEnumerator, TreeDictionary<K,V>, TreeSet<T>, TreeSet<T>.Enumerator, TreeSet<T>.Range.Enumerator, TreeSet<T>.SnapEnumerator

Value Types overview

EnumerationDirection, HashSet<T>.Feature, KeyValuePair<K,V>, SortedArray<T>.Feature, Speed, TreeBag<T>.Feature, TreeSet<T>.Feature

Delegates overview

Applier<T>, Filter<T>, Mapper<T,V>

Interface ICollectionValue<T>

A generic collection that may be enumerated and can answer efficiently how many items it contains. Like IEnumerable<T>, this interface does not prescribe any operations to initialize or update the collection. The main usage for this interface is to be the return type of query operations on generic collection.

Implements

System.Collections.Generic.IEnumerable<T>

Super

ICollection<T>, IDirectedCollectionValue<T>, IExtensible<T>, IIndexed<T>, IIndexedSorted<T>, IList<T>, IPersistentSorted<T>, IPriorityQueue<T>, ISequenced<T>, ISorted<T>

Implemented by

ArrayBase<T>, ArrayList<T>, CollectionBase<T>, CollectionValueBase<T>, GuardedCollection<T>, GuardedCollectionValue<T>, GuardedDirectedCollectionValue<T>, GuardedIndexedSorted<T>, GuardedList<T>, GuardedSequenced<T>, GuardedSorted<T>, HashBag<T>, HashedArrayList<T>, HashedLinkedList<T>, HashSet<T>, IntervalHeap<T>, LinkedList<T>, SequencedBase<T>, SortedArray<T>, TreeBag<T>, TreeSet<T>

Property overview

int Count, Speed CountSpeed

Method overview

bool All(Filter<T> filter), void Apply(Applier<T> a), void CopyTo(T[] a, int i), bool Exists(Filter<T> filter), T[] ToArray()

Property details

int Count Value: The number of items in this collection
Speed CountSpeed Value: A characterization of the speed of the Count property in this collection.The value is symbolic indicating the type of asymptotic complexity in terms of the size of this collection (worst-case or amortized as relevant).

Method details

void CopyTo(T[] a, int i) Copy the items of this collection to a contiguous part of an array.
a: The array to copy to
i: The index at which to copy the first item
T[] ToArray() Create an array with the items of this collection (in the same order as an enumerator would output them).
Returns: The array
void Apply(Applier<T> a) Apply a delegate to all items of this collection.
a: The delegate to apply
bool Exists(Filter<T> filter) Check if there exists an item that satisfies a specific predicate in this collection.
Returns: True is such an item exists
filter: A filter delegate (See ) defining the predicate
bool All(Filter<T> filter) Check if all items in this collection satisfies a specific predicate.
Returns: True if all items satisfies the predicate
filter: A filter delegate (See ) defining the predicate

Interface IDirectedEnumerable<T>

A generic collection, that can be enumerated backwards.

Implements

System.Collections.Generic.IEnumerable<T>

Super

IDirectedCollectionValue<T>, IIndexed<T>, IIndexedSorted<T>, IList<T>, IPersistentSorted<T>, ISequenced<T>, ISorted<T>

Implemented by

ArrayList<T>, GuardedDirectedCollectionValue<T>, GuardedDirectedEnumerable<T>, GuardedIndexedSorted<T>, GuardedList<T>, GuardedSequenced<T>, GuardedSorted<T>, HashedArrayList<T>, HashedLinkedList<T>, LinkedList<T>, SortedArray<T>, TreeBag<T>, TreeSet<T>

Property overview

EnumerationDirection Direction

Method overview

IDirectedEnumerable<T> Backwards()

Property details

EnumerationDirection Direction Value: The enumeration direction relative to the original collection. Forwards if same, else Backwards

Method details

IDirectedEnumerable<T> Backwards() Create a collection containing the same items as this collection, but whose enumerator will enumerate the items backwards. The new collection will become invalid if the original is modified. Method typicaly used as in foreach (T x in coll.Backwards()) {...}
Returns: The backwards collection.

Interface IDirectedCollectionValue<T>

A sized generic collection, that can be enumerated backwards.

Implements

System.Collections.Generic.IEnumerable<T>, ICollectionValue<T>, IDirectedEnumerable<T>

Super

IIndexed<T>, IIndexedSorted<T>, IList<T>, IPersistentSorted<T>, ISequenced<T>, ISorted<T>

Implemented by

ArrayList<T>, GuardedDirectedCollectionValue<T>, GuardedIndexedSorted<T>, GuardedList<T>, GuardedSequenced<T>, GuardedSorted<T>, HashedArrayList<T>, HashedLinkedList<T>, LinkedList<T>, SortedArray<T>, TreeBag<T>, TreeSet<T>

Method overview

IDirectedCollectionValue<T> Backwards()

Method details

IDirectedCollectionValue<T> Backwards() Create a collection containing the same items as this collection, but whose enumerator will enumerate the items backwards. The new collection will become invalid if the original is modified. Method typicaly used as in foreach (T x in coll.Backwards()) {...}
Returns: The backwards collection.

Interface IExtensible<T>

A generic collection to which one may add items. This is just the intersection of the main stream generic collection interfaces and the priority queue interface, See and See .

Implements

System.Collections.Generic.IEnumerable<T>, ICollectionValue<T>

Super

ICollection<T>, IIndexed<T>, IIndexedSorted<T>, IList<T>, IPersistentSorted<T>, IPriorityQueue<T>, ISequenced<T>, ISorted<T>

Implemented by

ArrayList<T>, GuardedCollection<T>, GuardedIndexedSorted<T>, GuardedList<T>, GuardedSequenced<T>, GuardedSorted<T>, HashBag<T>, HashedArrayList<T>, HashedLinkedList<T>, HashSet<T>, IntervalHeap<T>, LinkedList<T>, SortedArray<T>, TreeBag<T>, TreeSet<T>

Property overview

bool AllowsDuplicates, bool IsEmpty, object SyncRoot

Method overview

bool Add(T item), void AddAll<U>(System.Collections.Generic.IEnumerable<U> items), void AddAll(System.Collections.Generic.IEnumerable<T> items), bool Check()

Property details

bool AllowsDuplicates Value: False if this collection has set semantics, true if bag semantics.
object SyncRoot Value: An object to be used for locking to enable multi threaded code to acces this collection safely.
bool IsEmpty Value: True if this collection is empty.

Method details

void AddAll<U>(System.Collections.Generic.IEnumerable<U> items) Add the elements from another collection with a more specialized item type to this collection. If this collection has set semantics, only items not already in the collection will be added.
items: The items to add
bool Add(T item) Add an item to this collection if possible. If this collection has set semantics, the item will be added if not already in the collection. If bag semantics, the item will always be added.
Returns: True if item was added.
item: The item to add.
void AddAll(System.Collections.Generic.IEnumerable<T> items) Add the elements from another collection to this collection. If this collection has set semantics, only items not already in the collection will be added.
items: The items to add.
bool Check() Check the integrity of the internal data structures of this collection.

This is only relevant for developers of the library

Returns: True if check was passed.

Interface ICollection<T>

The simplest interface of a main stream generic collection with lookup, insertion and removal operations.

Implements

System.Collections.Generic.IEnumerable<T>, ICollectionValue<T>, IExtensible<T>

Super

IIndexed<T>, IIndexedSorted<T>, IList<T>, IPersistentSorted<T>, ISequenced<T>, ISorted<T>

Implemented by

ArrayList<T>, GuardedCollection<T>, GuardedIndexedSorted<T>, GuardedList<T>, GuardedSequenced<T>, GuardedSorted<T>, HashBag<T>, HashedArrayList<T>, HashedLinkedList<T>, HashSet<T>, LinkedList<T>, SortedArray<T>, TreeBag<T>, TreeSet<T>

Property overview

Speed ContainsSpeed, bool IsReadOnly

Method overview

void Clear(), bool Contains(T item), bool ContainsAll(System.Collections.Generic.IEnumerable<T> items), int ContainsCount(T item), bool Equals(ICollection<T> that), bool Find(ref T item), bool FindOrAdd(ref T item), int GetHashCode(), bool Remove(T item), void RemoveAll(System.Collections.Generic.IEnumerable<T> items), void RemoveAllCopies(T item), bool RemoveWithReturn(ref T item), void RetainAll(System.Collections.Generic.IEnumerable<T> items), bool Update(T item), bool UpdateOrAdd(T item)

Property details

bool IsReadOnly Value: True if this collection is read only.If true any call of an updating operation will throw an InvalidOperationException
Speed ContainsSpeed Value: A characterization of the speed of lookup operations (Contains() etc.) of the implementation of this list.The value is symbolic indicating the type of asymptotic complexity in terms of the size of this collection (worst-case or amortized as relevant).

Method details

int GetHashCode() The hashcode is defined as the sum of h(item) over the items of the collection, where the function h is???
Returns: The unordered hashcode of this collection.
bool Equals(ICollection<T> that) Compare the contents of this collection to another one without regards to the sequence order. The comparison will use this collection's itemhasher to compare individual items.
Returns: True if this collection and that contains the same items.
that: The collection to compare to.
bool Contains(T item) Check if this collection contains (an item equivalent to according to the itemhasher) a particular value.
Returns: True if the items is in this collection.
item: The value to check for.
int ContainsCount(T item) Count the number of items of the collection equal to a particular value. Returns 0 if and only if the value is not in the collection.
Returns: The number of copies found.
item: The value to count.
bool ContainsAll(System.Collections.Generic.IEnumerable<T> items) Check if this collection contains all the values in another collection. If this collection has bag semantics (NoDuplicates==false) the check is made with respect to multiplicities, else multiplicities are not taken into account.
Returns: True if all values in itemsis in this collection.
items: The
bool Find(ref T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, return in the ref argument (a binary copy of) the actual value found.
Returns: True if the items is in this collection.
item: The value to look for.
bool FindOrAdd(ref T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, return in the ref argument (a binary copy of) the actual value found. Else, add the item to the collection.
Returns: True if the item was found (hence not added).
item: The value to look for.
bool Update(T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, update the item in the collection to with a binary copy of the supplied value. If the collection has bag semantics, it is implementation dependent if this updates all equivalent copies in the collection or just one.
Returns: True if the item was found and hence updated.
item: Value to update.
bool UpdateOrAdd(T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, update the item in the collection to with a binary copy of the supplied value; else add the value to the collection.
Returns: True if the item was found and updated (hence not added).
item: Value to add or update.
bool Remove(T item) Remove a particular item from this collection. If the collection has bag semantics only one copy equivalent to the supplied item is removed.
Returns: True if the item was found (and removed).
item: The value to remove.
bool RemoveWithReturn(ref T item) Remove a particular item from this collection if found. If the collection has bag semantics only one copy equivalent to the supplied item is removed, which one is implementation dependent. If an item was removed, report a binary copy of the actual item removed in the argument.
Returns: True if the item was found (and removed).
item: The value to remove on input.
void RemoveAllCopies(T item) Remove all items equivalent to a given value.
item: The value to remove.
void RemoveAll(System.Collections.Generic.IEnumerable<T> items) Remove all items in another collection from this one. If this collection has bag semantics, take multiplicities into account.
items: The items to remove.
void Clear() Remove all items from this collection.
void RetainAll(System.Collections.Generic.IEnumerable<T> items) Remove all items not in some other collection from this one. If this collection has bag semantics, take multiplicities into account.
items: The items to retain.

Interface ISequenced<T>

An editable collection maintaining a definite sequence order of the items.

Implementations of this interface must compute the hash code and equality exactly as prescribed in the method definitions in order to be consistent with other collection classes implementing this interface.

This interface is usually implemented by explicit interface implementation, not as ordinary virtual methods.

Implements

System.Collections.Generic.IEnumerable<T>, ICollection<T>, ICollectionValue<T>, IDirectedCollectionValue<T>, IDirectedEnumerable<T>, IExtensible<T>

Super

IIndexed<T>, IIndexedSorted<T>, IList<T>, IPersistentSorted<T>, ISorted<T>

Implemented by

ArrayList<T>, GuardedIndexedSorted<T>, GuardedList<T>, GuardedSequenced<T>, GuardedSorted<T>, HashedArrayList<T>, HashedLinkedList<T>, LinkedList<T>, SortedArray<T>, TreeBag<T>, TreeSet<T>

Method overview

bool Equals(ISequenced<T> that), int GetHashCode()

Method details

int GetHashCode() The hashcode is defined as h(...h(h(x1),x2)...,xn) for h(a,b)=31*a+b and the x's the hash codes of
Returns: The sequence order hashcode of this collection.
bool Equals(ISequenced<T> that) Compare this sequenced collection to another one in sequence order.
Returns: True if this collection and that contains equal (according to this collection's itemhasher) in the same sequence order.
that: The sequenced collection to compare to.

Interface IIndexed<T>

A sequenced collection, where indices of items in the order are maintained

Implements

System.Collections.Generic.IEnumerable<T>, ICollection<T>, ICollectionValue<T>, IDirectedCollectionValue<T>, IDirectedEnumerable<T>, IExtensible<T>, ISequenced<T>

Super

IIndexedSorted<T>, IList<T>

Implemented by

ArrayList<T>, GuardedIndexedSorted<T>, GuardedList<T>, HashedArrayList<T>, HashedLinkedList<T>, LinkedList<T>, SortedArray<T>, TreeBag<T>, TreeSet<T>

Property overview

T this[int i], IDirectedCollectionValue<T> this[int start, int count]

Method overview

int IndexOf(T item), int LastIndexOf(T item), T RemoveAt(int i), void RemoveInterval(int start, int count)

Property details

T this[int i] Value: The i'th item of this list.
Throws System.IndexOutOfRangeException if i is negative or >= the size of the collection.
i: the index to lookup
IDirectedCollectionValue<T> this[int start, int count] Value: The directed collection of items in a specific index interval.
Throws System.IndexOutOfRangeException.
start: The low index of the interval (inclusive).
count: The size of the range.

Method details

int IndexOf(T item) Searches for an item in the list going forwrds from the start.
Returns: Index of item from start.
item: Item to search for.
int LastIndexOf(T item) Searches for an item in the list going backwords from the end.
Returns: Index of of item from the end.
item: Item to search for.
T RemoveAt(int i) Remove the item at a specific position of the list.
Throws System.IndexOutOfRangeException if i is negative or >= the size of the collection.
Returns: The removed item.
i: The index of the item to remove.
void RemoveInterval(int start, int count) Remove all items in an index interval.
Throws System.IndexOutOfRangeException???.
start: The index of the first item to remove.
count: The number of items to remove.

Interface IStack<T>

The interface describing the operations of a LIFO stack data structure.

Super

IList<T>

Implemented by

ArrayList<T>, GuardedList<T>, HashedArrayList<T>, HashedLinkedList<T>, LinkedList<T>

Method overview

T Pop(), void Push(T item)

Method details

void Push(T item) Push an item to the top of the stack.
item: The item
T Pop() Pop the item at the top of the stack from the stack.
Returns: The popped item.

Interface IQueue<T>

The interface describing the operations of a FIFO queue data structure.

Super

IList<T>

Implemented by

ArrayList<T>, GuardedList<T>, HashedArrayList<T>, HashedLinkedList<T>, LinkedList<T>

Method overview

T DeQueue(), void EnQueue(T item)

Method details

void EnQueue(T item) Enqueue an item at the back of the queue.
item: The item
T DeQueue() Dequeue an item from the front of the queue.
Returns: The item

Interface IList<T>

This is an indexed collection, where the item order is chosen by the user at insertion time. NBNBNB: we neeed a description of the view functionality here!

Implements

System.Collections.Generic.IEnumerable<T>, ICollection<T>, ICollectionValue<T>, IDirectedCollectionValue<T>, IDirectedEnumerable<T>, IExtensible<T>, IIndexed<T>, IQueue<T>, ISequenced<T>, IStack<T>

Implemented by

ArrayList<T>, GuardedList<T>, HashedArrayList<T>, HashedLinkedList<T>, LinkedList<T>

Property overview

bool FIFO, T First, T this[int i], T Last, int Offset, IList<T> Underlying

Method overview

IList<T> FindAll(Filter<T> filter), void Insert(int i, T item), void InsertAfter(T item, T target), void InsertAll(int i, System.Collections.Generic.IEnumerable<T> items), void InsertBefore(T item, T target), void InsertFirst(T item), void InsertLast(T item), bool IsSorted(IComparer<T> c), IList<V> Map<V>(Mapper<T,V> mapper), IList<V> Map<V>(Mapper<T,V> mapper, IHasher<V> hasher), T Remove(), T RemoveFirst(), T RemoveLast(), void Reverse(), void Reverse(int start, int count), void Shuffle(), void Shuffle(System.Random rnd), void Slide(int offset), void Slide(int offset, int size), void Sort(IComparer<T> c), IList<T> View(int start, int count)

Property details

T First Value: The first item in this list.
Throws System.InvalidOperationException if this list is empty.
T Last Value: The last item in this list.
Throws System.InvalidOperationException if this list is empty.
bool FIFO Value: True if the Remove() operation removes from the start of the list, false if it removes from the end.Since Add(T item) always add at the end of the list, this describes if list has FIFO or LIFO semantics.
T this[int i] Value: The i'th item of this list.On this list, this indexer is read/write.
Throws System.IndexOutOfRangeException if i is negative or >= the size of the collection.
i: The index of the item to fetch or store.
IList<T> Underlying Value: Underlying list for view.Null if this list is not a view.
int Offset Value: Offset for this list view or 0 for an underlying list.

Method details

IList<V> Map<V>(Mapper<T,V> mapper) Create a new list consisting of the results of mapping all items of this list. The new list will use the default hasher for the item type V.
Returns: The new list.
mapper: The delegate defining the map.
IList<V> Map<V>(Mapper<T,V> mapper, IHasher<V> hasher) Create a new list consisting of the results of mapping all items of this list. The new list will use a specified hasher for the item type.
Returns: The new list.
mapper: The delegate defining the map.
hasher: The hasher to use for the new list
void Insert(int i, T item) Insert an item at a specific index location in this list.
Throws System.IndexOutOfRangeException if i is negative or > the size of the collection.
i: The index at which to insert.
item: The item to insert.
void InsertFirst(T item) Insert an item at the front of this list.
Throws System.InvalidOperationException if the list has NoDuplicates=true and the item is already in the list.
item: The item to insert.
void InsertLast(T item) Insert an item at the back of this list.
Throws System.InvalidOperationException if the list has NoDuplicates=true and the item is already in the list.
item: The item to insert.
void InsertBefore(T item, T target) Insert an item right before the first occurrence of some target item.
Throws System.InvalidOperationException if target is not found or if the list has NoDuplicates=true and the item is already in the list.
item: The item to insert.
target: The target before which to insert.
void InsertAfter(T item, T target) Insert an item right after the last(???) occurrence of some target item.
Throws System.InvalidOperationException if target is not found or if the list has NoDuplicates=true and the item is already in the list.
item: The item to insert.
target: The target after which to insert.
void InsertAll(int i, System.Collections.Generic.IEnumerable<T> items) Insert into this list all items from an enumerable collection starting at a particular index.
Throws System.IndexOutOfRangeException if i is negative or > the size of the collection.
Throws System.InvalidOperationException if the list has NoDuplicates=true and one of the items to insert is already in the list.
i: Index to start inserting at
items: Items to insert
IList<T> FindAll(Filter<T> filter) Create a new list consisting of the items of this list satisfying a certain predicate.
Returns: The new list.
filter: The filter delegate defining the predicate.
T Remove() Remove one item from the list: from the front if FIFO is true, else from the back.
Throws System.InvalidOperationException if this list is empty.
Returns: The removed item.
T RemoveFirst() Remove one item from the fromnt of the list.
Throws System.InvalidOperationException if this list is empty.
Returns: The removed item.
T RemoveLast() Remove one item from the back of the list.
Throws System.InvalidOperationException if this list is empty.
Returns: The removed item.
IList<T> View(int start, int count) Create a list view on this list.
Throws System.ArgumentOutOfRangeException if the view would not fit into this list.
Returns: The new list view.
start: The index in this list of the start of the view.
count: The size of the view.
void Slide(int offset) Slide this list view along the underlying list.
Throws System.InvalidOperationException if this list is not a view.
Throws System.ArgumentOutOfRangeException if the operation would bring either end of the view outside the underlying list.
offset: The signed amount to slide: positive to slide towards the end.
void Slide(int offset, int size) Slide this list view along the underlying list, changing its size.
Throws System.InvalidOperationException if this list is not a view.
Throws System.ArgumentOutOfRangeException if the operation would bring either end of the view outside the underlying list.
offset: The signed amount to slide: positive to slide towards the end.
size: The new size of the view.
void Reverse() Reverse the list so the items are in the opposite sequence order.
void Reverse(int start, int count) Reverst part of the list so the items are in the opposite sequence order.
Throws System.ArgumentException if the count is negative.
Throws System.ArgumentOutOfRangeException if the part does not fit into the list.
start: The index of the start of the part to reverse.
count: The size of the part to reverse.
bool IsSorted(IComparer<T> c) Check if this list is sorted according to a specific sorting order.
Returns: True if the list is sorted, else false.
c: The comparer defining the sorting order.
void Sort(IComparer<T> c) Sort the items of the list according to a specific sorting order.
c: The comparer defining the sorting order.
void Shuffle() Randonmly shuffle the items of this list.
void Shuffle(System.Random rnd) Shuffle the items of this list according to a specific random source.
rnd: The random source.

Interface IPriorityQueue<T>

A generic collection of items prioritized by a comparison (order) relation. Supports adding items and reporting or removing extremal elements. The priority queue itself exports the used order relation through its implementation of IComparer<T>

Implements

System.Collections.Generic.IEnumerable<T>, ICollectionValue<T>, IExtensible<T>

Super

IIndexedSorted<T>, IPersistentSorted<T>, ISorted<T>

Implemented by

GuardedIndexedSorted<T>, GuardedSorted<T>, IntervalHeap<T>, SortedArray<T>, TreeBag<T>, TreeSet<T>

Property overview

IComparer<T> Comparer

Method overview

T DeleteMax(), T DeleteMin(), T FindMax(), T FindMin()

Property details

IComparer<T> Comparer Value: The comparerThe comparer object supplied at creation time for this collection

Method details

T FindMin() Find the current least item of this priority queue.
Returns: The least item.
T DeleteMin() Remove the least item from this priority queue.
Returns: The removed item.
T FindMax() Find the current largest item of this priority queue.
Returns: The largest item.
T DeleteMax() Remove the largest item from this priority queue.
Returns: The removed item.

Interface ISorted<T>

A collection where items are maintained in sorted order.

Implements

System.Collections.Generic.IEnumerable<T>, ICollection<T>, ICollectionValue<T>, IDirectedCollectionValue<T>, IDirectedEnumerable<T>, IExtensible<T>, IPriorityQueue<T>, ISequenced<T>

Super

IIndexedSorted<T>, IPersistentSorted<T>

Implemented by

GuardedIndexedSorted<T>, GuardedSorted<T>, SortedArray<T>, TreeBag<T>, TreeSet<T>

Method overview

void AddSorted(System.Collections.Generic.IEnumerable<T> items), bool Cut(System.IComparable<T> c, out T low, out bool lowIsValid, out T high, out bool highIsValid), T Predecessor(T item), IDirectedCollectionValue<T> RangeAll(), IDirectedEnumerable<T> RangeFrom(T bot), IDirectedEnumerable<T> RangeFromTo(T bot, T top), IDirectedEnumerable<T> RangeTo(T top), void RemoveRangeFrom(T low), void RemoveRangeFromTo(T low, T hi), void RemoveRangeTo(T hi), T Successor(T item), T WeakPredecessor(T item), T WeakSuccessor(T item)

Method details

T Predecessor(T item) Find the strict predecessor in the sorted collection of a particular value, i.e. the largest item in the collection less than the supplied value.
Throws System.InvalidOperationException if no such element exists (the supplied value is less than or equal to the minimum of this collection.)
Returns: The predecessor.
item: The item to find the predecessor for.
T Successor(T item) Find the strict successor in the sorted collection of a particular value, i.e. the least item in the collection greater than the supplied value.
Throws System.InvalidOperationException if no such element exists (the supplied value is greater than or equal to the maximum of this collection.)
Returns: The successor.
item: The item to find the successor for.
T WeakPredecessor(T item) Find the weak predecessor in the sorted collection of a particular value, i.e. the largest item in the collection less than or equal to the supplied value.
Throws System.InvalidOperationException if no such element exists (the supplied value is less than the minimum of this collection.)
Returns: The weak predecessor.
item: The item to find the weak predecessor for.
T WeakSuccessor(T item) Find the weak successor in the sorted collection of a particular value, i.e. the least item in the collection greater than or equal to the supplied value.
Throws System.InvalidOperationException if no such element exists (the supplied value is greater than the maximum of this collection.)
Returns: The weak successor.
item: The item to find the weak successor for.
bool Cut(System.IComparable<T> c, out T low, out bool lowIsValid, out T high, out bool highIsValid) Perform a search in the sorted collection for the ranges in which a non-decreasing function from the item type to int is negative, zero respectively positive. If the supplied cut function is not non-decreasing, the result of this call is undefined.
Returns:
c: The cut function T to int, given as an IComparable<T> object, where the cut function is the c.CompareTo(T that) method.
low: Returns the largest item in the collection, where the cut function is negative (if any).
lowIsValid: True if the cut function is negative somewhere on this collection.
high: Returns the least item in the collection, where the cut function is positive (if any).
highIsValid: True if the cut function is positive somewhere on this collection.
IDirectedEnumerable<T> RangeFrom(T bot) Query this sorted collection for items greater than or equal to a supplied value.
Returns: The result directed collection.
bot: The lower bound (inclusive).
IDirectedEnumerable<T> RangeFromTo(T bot, T top) Query this sorted collection for items between two supplied values.
Returns: The result directed collection.
bot: The lower bound (inclusive).
top: The upper bound (exclusive).
IDirectedEnumerable<T> RangeTo(T top) Query this sorted collection for items less than a supplied value.
Returns: The result directed collection.
top: The upper bound (exclusive).
IDirectedCollectionValue<T> RangeAll() Create a directed collection with the same items as this collection.
Returns: The result directed collection.
void AddSorted(System.Collections.Generic.IEnumerable<T> items) Add all the items from another collection with an enumeration order that is increasing in the items.
Throws System.ArgumentException if the enumerated items turns out not to be in increasing order.
items: The collection to add.
void RemoveRangeFrom(T low) Remove all items of this collection above or at a supplied threshold.
low: The lower threshold (inclusive).
void RemoveRangeFromTo(T low, T hi) Remove all items of this collection between two supplied thresholds.
low: The lower threshold (inclusive).
hi: The upper threshold (exclusive).
void RemoveRangeTo(T hi) Remove all items of this collection below a supplied threshold.
hi: The upper threshold (exclusive).

Interface IIndexedSorted<T>

A collection where items are maintained in sorted order together with their indexes in that order.

Implements

System.Collections.Generic.IEnumerable<T>, ICollection<T>, ICollectionValue<T>, IDirectedCollectionValue<T>, IDirectedEnumerable<T>, IExtensible<T>, IIndexed<T>, IPriorityQueue<T>, ISequenced<T>, ISorted<T>

Implemented by

GuardedIndexedSorted<T>, SortedArray<T>, TreeBag<T>, TreeSet<T>

Method overview

int CountFrom(T bot), int CountFromTo(T bot, T top), int CountTo(T top), IIndexedSorted<T> FindAll(Filter<T> f), IIndexedSorted<V> Map<V>(Mapper<T,V> m, IComparer<V> c), IDirectedCollectionValue<T> RangeFrom(T bot), IDirectedCollectionValue<T> RangeFromTo(T bot, T top), IDirectedCollectionValue<T> RangeTo(T top)

Method details

IIndexedSorted<V> Map<V>(Mapper<T,V> m, IComparer<V> c) Create a new indexed sorted collection consisting of the results of mapping all items of this list.
Throws System.ArgumentException if the map is not increasing over the items of this collection (with respect to the two given comparison relations).
Returns: The new sorted collection.
m: The delegate definging the map.
c: The comparion relation to use for the result.
int CountFrom(T bot) Determine the number of items at or above a supplied threshold.
Returns: The number of matcing items.
bot: The lower bound (inclusive)
int CountFromTo(T bot, T top) Determine the number of items between two supplied thresholds.
Returns: The number of matcing items.
bot: The lower bound (inclusive)
top: The upper bound (exclusive)
int CountTo(T top) Determine the number of items below a supplied threshold.
Returns: The number of matcing items.
top: The upper bound (exclusive)
IDirectedCollectionValue<T> RangeFrom(T bot) Query this sorted collection for items greater than or equal to a supplied value.
Returns: The result directed collection.
bot: The lower bound (inclusive).
IDirectedCollectionValue<T> RangeFromTo(T bot, T top) Query this sorted collection for items between two supplied values.
Returns: The result directed collection.
bot: The lower bound (inclusive).
top: The upper bound (exclusive).
IDirectedCollectionValue<T> RangeTo(T top) Query this sorted collection for items less than a supplied value.
Returns: The result directed collection.
top: The upper bound (exclusive).
IIndexedSorted<T> FindAll(Filter<T> f) Create a new indexed sorted collection consisting of the items of this indexed sorted collection satisfying a certain predicate.
Returns: The new indexed sorted collection.
f: The filter delegate defining the predicate.

Interface IDictionary<K,V>

A dictionary with keys of type K and values of type V. Equivalent to a finite partial map from K to V.

Implements

System.Collections.Generic.IEnumerable<KeyValuePair<K,V>>

Super

ISortedDictionary<K,V>

Implemented by

DictionaryBase<K,V>, GuardedDictionary<K,V>, GuardedSortedDictionary<K,V>, HashDictionary<K,V>, TreeDictionary<K,V>

Property overview

int Count, bool IsReadOnly, V this[K key], ICollectionValue<K> Keys, object SyncRoot, ICollectionValue<V> Values

Method overview

void Add(K key, V val), bool Check(), void Clear(), bool Contains(K key), bool Find(K key, out V val), bool FindOrAdd(K key, ref V val), bool Remove(K key), bool Remove(K key, out V val), bool Update(K key, V val), bool UpdateOrAdd(K key, V val)

Property details

V this[K key] Value: The value corresponding to the keyIndexer for dictionary.
Throws System.InvalidOperationException if no entry is found.
key:
int Count Value: The number of entrues in the dictionary
bool IsReadOnly Value: True if dictionary is read only
object SyncRoot Value: The distinguished object to use for locking to synchronize multithreaded access
ICollectionValue<K> Keys Value: A collection containg the all the keys of the dictionary
ICollectionValue<V> Values Value: A collection containing all the values of the dictionary

Method details

void Add(K key, V val) Add a new (key, value) pair (a mapping) to the dictionary.
Throws System.InvalidOperationException if there already is an entry with the same key.
key: Key to add
val: Value to add
bool Remove(K key) Remove an entry with a given key from the dictionary
Returns: True if an entry was found (and removed)
key: The key of the entry to remove
bool Remove(K key, out V val) Remove an entry with a given key from the dictionary and report its value.
Returns: True if an entry was found (and removed)
key: The key of the entry to remove
val: On exit, the value of the removed entry
void Clear() Remove all entries from the dictionary
bool Contains(K key) Check if there is an entry with a specified key
Returns: True if key was found
key: The key to look for
bool Find(K key, out V val) Check if there is an entry with a specified key and report the corresponding value if found. This can be seen as a safe form of "val = this[key]".
Returns: True if key was found
key: The key to look for
val: On exit, the value of the entry
bool Update(K key, V val) Look for a specific key in the dictionary and if found replace the value with a new one. This can be seen as a non-adding version of "this[key] = val".
Returns: True if key was found
key: The key to look for
val: The new value
bool FindOrAdd(K key, ref V val) Look for a specific key in the dictionary. If found, report the corresponding value, else add an entry with the key and the supplied value.
Returns: True if key was found
key: The key to look for
val: On entry the value to add if the key is not found. On exit the value found if any.
bool UpdateOrAdd(K key, V val) Update value in dictionary corresponding to key if found, else add new entry. More general than "this[key] = val;" by reporting if key was found.
Returns: True if key was found and value updated.
key: The key to look for
val: The value to add or replace with.
bool Check() Check the integrity of the internal data structures of this dictionary. Only avaliable in DEBUG builds???
Returns: True if check does not fail.

Interface ISortedDictionary<K,V>

A dictionary with sorted keys.

Implements

System.Collections.Generic.IEnumerable<KeyValuePair<K,V>>, IDictionary<K,V>

Implemented by

GuardedSortedDictionary<K,V>, TreeDictionary<K,V>

Method overview

KeyValuePair<K,V> Predecessor(K key), KeyValuePair<K,V> Successor(K key), KeyValuePair<K,V> WeakPredecessor(K key), KeyValuePair<K,V> WeakSuccessor(K key)

Method details

KeyValuePair<K,V> Predecessor(K key) Find the entry with the largest key less than a given key.
Throws System.InvalidOperationException if there is no such entry.
Returns: The entry
key: The key to compare to
KeyValuePair<K,V> Successor(K key) Find the entry with the least key greater than a given key.
Throws System.InvalidOperationException if there is no such entry.
Returns: The entry
key: The key to compare to
KeyValuePair<K,V> WeakPredecessor(K key) Find the entry with the largest key less than or equal to a given key.
Throws System.InvalidOperationException if there is no such entry.
Returns: The entry
key: The key to compare to
KeyValuePair<K,V> WeakSuccessor(K key) Find the entry with the least key greater than or equal to a given key.
Throws System.InvalidOperationException if there is no such entry.
Returns: The entry
key: The key to compare to

Interface IComparer<T>

The type of an item comparer

Implementations of this interface must asure that the method is self-consistent and defines a sorting order on items, or state precise conditions under which this is true.

Implementations must assure that repeated calls of the method to the same (in reference or binary identity sense) arguments will return values with the same sign (-1, 0 or +1), or state precise conditions under which the user can be assured repeated calls will return the same sign.

Implementations of this interface must always return values from the method and never throw exceptions.

This interface is identical to System.Collections.Generic.IComparer<T>

Implemented by

KeyValuePairComparer<K,V>, NaturalComparer<T>, NaturalComparerO<T>

Method overview

int Compare(T a, T b)

Method details

int Compare(T a, T b) Compare two items with respect to this item comparer
Returns: Positive if a is greater than b, 0 if they are equal, negative if a is less than b
a: First item
b: Second item

Interface IHasher<T>

The type of an item hasher.

Implementations of this interface must assure that the methods are consistent, i.e. that whenever two items i1 and i2 satisfies that Equals(i1,i2) returns true, then GetHashCode returns the same values for i1 and i2.

Implementations of this interface must assure that repeated calls of the methods to the same (in reference or binary identity sense) arguments will return the same values, or state precise conditions under which the user can be assured repeated calls will return the same values.

Implementations of this interface must always return values from the methods and never throw exceptions.

This interface is similar in function to System.IKeyComparer<T>

Implemented by

DefaultReferenceTypeHasher<T>, DefaultValueTypeHasher<T>, HasherBuilder.ByInvoke<T>, HasherBuilder.SequencedHasher<S,W>, HasherBuilder.UnsequencedHasher<S,W>, IntHasher, KeyValuePairHasher<K,V>

Method overview

bool Equals(T i1, T i2), int GetHashCode(T item)

Method details

int GetHashCode(T item) Get the hash code with respect to this item hasher
Returns: The hash code
item: The item
bool Equals(T i1, T i2) Check if two items are equal with respect to this item hasher
Returns: True if equal
i1: first item
i2: second item

Interface IPersistentSorted<T>

The type of a sorted collection with persistence

Implements

System.Collections.Generic.IEnumerable<T>, System.IDisposable, ICollection<T>, ICollectionValue<T>, IDirectedCollectionValue<T>, IDirectedEnumerable<T>, IExtensible<T>, IPriorityQueue<T>, ISequenced<T>, ISorted<T>

Implemented by

TreeBag<T>, TreeSet<T>

Method overview

ISorted<T> Snapshot()

Method details

ISorted<T> Snapshot() Make a (read-only) snap shot of this collection.
Returns: The snap shot.

Class EnumerableBase<T>

A base class for implementing an IEnumerable<T>

Implements

System.Collections.Generic.IEnumerable<T>

Bases

object

Base of

ArrayBase<T>, ArrayList<T>, CollectionBase<T>, CollectionValueBase<T>, DictionaryBase<K,V>, HashBag<T>, HashDictionary<K,V>, HashedArrayList<T>, HashedLinkedList<T>, HashSet<T>, IntervalHeap<T>, LinkedList<T>, SequencedBase<T>, SortedArray<T>, TreeBag<T>, TreeDictionary<K,V>, TreeSet<T>

Constructor overview

EnumerableBase<T>()

Method overview

int countItems(System.Collections.Generic.IEnumerable<T> items), bool Equals(object obj), void Finalize(), System.Collections.Generic.IEnumerator<T> GetEnumerator(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), string ToString()

Constructor details

PEnumerableBase<T>()

Method details

System.Collections.Generic.IEnumerator<T> GetEnumerator() Create an enumerator for this collection.
Returns: The enumerator
NSPint countItems(System.Collections.Generic.IEnumerable<T> items) Count the number of items in an enumerable by enumeration
Returns: The size of the enumerable
items: The enumerable to count
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class CollectionValueBase<T>

Base class for classes implementing ICollectionValue[T]

Implements

System.Collections.Generic.IEnumerable<T>, ICollectionValue<T>

Bases

object, EnumerableBase<T>

Base of

ArrayBase<T>, ArrayList<T>, CollectionBase<T>, HashBag<T>, HashedArrayList<T>, HashedLinkedList<T>, HashSet<T>, IntervalHeap<T>, LinkedList<T>, SequencedBase<T>, SortedArray<T>, TreeBag<T>, TreeSet<T>

Property overview

int Count, Speed CountSpeed

Constructor overview

CollectionValueBase<T>()

Method overview

bool All(Filter<T> filter), void Apply(Applier<T> a), void CopyTo(T[] a, int i), bool Equals(object obj), bool Exists(Filter<T> filter), void Finalize(), System.Collections.Generic.IEnumerator<T> GetEnumerator(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), T[] ToArray(), string ToString()

Property details

int Count Value: The number of items in this collection.
Speed CountSpeed Value: A characterization of the speed of the Count property in this collection.The value is symbolic indicating the type of asymptotic complexity in terms of the size of this collection (worst-case or amortized as relevant).

Constructor details

PCollectionValueBase<T>()

Method details

void CopyTo(T[] a, int i) Copy the items of this collection to part of an array.
Throws System.ArgumentOutOfRangeException if i is negative.
Throws System.ArgumentException if the array does not have room for the items.
a: The array to copy to
i: The starting index.
T[] ToArray() Create an array with the items of this collection (in the same order as an enumerator would output them).
Returns: The array
void Apply(Applier<T> a) Apply an Applier<T> to this enumerable
a: The applier delegate
bool Exists(Filter<T> filter) Check if there exists an item that satisfies a specific predicate in this collection.
Returns: True is such an item exists
filter: A filter delegate (See ) defining the predicate
bool All(Filter<T> filter) Check if all items in this collection satisfies a specific predicate.
Returns: True if all items satisfies the predicate
filter: A filter delegate (See ) defining the predicate
System.Collections.Generic.IEnumerator<T> GetEnumerator() Create an enumerator for this collection.
Returns: The enumerator
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class CollectionBase<T>

Base class (abstract) for ICollection implementations.

Implements

System.Collections.Generic.IEnumerable<T>, ICollectionValue<T>

Bases

object, EnumerableBase<T>, CollectionValueBase<T>

Base of

ArrayBase<T>, ArrayList<T>, HashBag<T>, HashedArrayList<T>, HashedLinkedList<T>, HashSet<T>, LinkedList<T>, SequencedBase<T>, SortedArray<T>, TreeBag<T>, TreeSet<T>

Field overview

bool isReadOnly, IHasher<T> itemhasher, int size, int stamp

Property overview

int Count, Speed CountSpeed, bool IsEmpty, bool IsReadOnly, object SyncRoot

Constructor overview

CollectionBase<T>()

Method overview

bool All(Filter<T> filter), void Apply(Applier<T> a), void checkRange(int start, int count), int ComputeHashCode(ICollectionValue<T> items, IHasher<T> itemhasher), void CopyTo(T[] a, int i), bool Equals(object obj), bool Exists(Filter<T> filter), void Finalize(), System.Collections.Generic.IEnumerator<T> GetEnumerator(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), void modifycheck(int thestamp), bool StaticEquals(ICollection<T> tit, ICollection<T> tat, IHasher<T> itemhasher), T[] ToArray(), string ToString(), bool unsequencedequals(ICollection<T> that), int unsequencedhashcode(), void updatecheck()

Field details

Pbool isReadOnly The underlying field of the ReadOnly property
Pint stamp The current stamp value
Pint size The number of items in the collection
PIHasher<T> itemhasher The item hasher of the collection

Property details

bool IsReadOnly Value: True if this collection is read only
int Count Value: The size of this collection
Speed CountSpeed Value: A characterization of the speed of the Count property in this collection.The value is symbolic indicating the type of asymptotic complexity in terms of the size of this collection (worst-case or amortized as relevant).
object SyncRoot Value: A distinguished object to use for locking to synchronize multithreaded access
bool IsEmpty Value: True is this collection is empty

Constructor details

PCollectionBase<T>()

Method details

NPvoid checkRange(int start, int count) Utility method for range checking.
Throws System.ArgumentOutOfRangeException if the start or count is negative
Throws System.ArgumentException if the range does not fit within collection size.
start: start of range
count: size of range
NSint ComputeHashCode(ICollectionValue<T> items, IHasher<T> itemhasher) Compute the unsequenced hash code of a collection
Returns: The hash code
items: The collection to compute hash code for
itemhasher: The item hasher
NSbool StaticEquals(ICollection<T> tit, ICollection<T> tat, IHasher<T> itemhasher) Examine if tit and tat are equal as unsequenced collections using the specified item hasher (assumed compatible with the two collections).
Returns: True if equal
tit: The first collection
tat: The second collection
itemhasher: The item hasher to use for comparison
NPint unsequencedhashcode() Get the unsequenced collection hash code of this collection: from the cached value if present and up to date, else (re)compute.
Returns: The hash code
NPbool unsequencedequals(ICollection<T> that) Check if the contents of that is equal to the contents of this in the unsequenced sense. Using the item hasher of this collection.
Returns: True if equal
that: The collection to compare to.
Pvoid modifycheck(int thestamp)
Throws System.InvalidOperationException if this collection has been updated since a target time
thestamp: The stamp identifying the target time
Pvoid updatecheck() Check if it is valid to perform update operations, and if so increment stamp
System.Collections.Generic.IEnumerator<T> GetEnumerator() Create an enumerator for this collection.
Returns: The enumerator
void CopyTo(T[] a, int i) Inherited from CollectionValueBase{T}: void CopyTo(T[] a, int i)
T[] ToArray() Inherited from CollectionValueBase{T}: T[] ToArray()
void Apply(Applier<T> a) Inherited from CollectionValueBase{T}: void Apply(Applier<T> a)
bool Exists(Filter<T> filter) Inherited from CollectionValueBase{T}: bool Exists(Filter<T> filter)
bool All(Filter<T> filter) Inherited from CollectionValueBase{T}: bool All(Filter<T> filter)
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class SequencedBase<T>

Base class (abstract) for sequenced collection implementations.

Implements

System.Collections.Generic.IEnumerable<T>, ICollectionValue<T>

Bases

object, EnumerableBase<T>, CollectionValueBase<T>, CollectionBase<T>

Base of

ArrayBase<T>, ArrayList<T>, HashedArrayList<T>, HashedLinkedList<T>, LinkedList<T>, SortedArray<T>, TreeBag<T>, TreeSet<T>

Field overview

bool isReadOnly, IHasher<T> itemhasher, int size, int stamp

Property overview

int Count, Speed CountSpeed, EnumerationDirection Direction, bool IsEmpty, bool IsReadOnly, object SyncRoot

Constructor overview

SequencedBase<T>()

Method overview

bool All(Filter<T> filter), void Apply(Applier<T> a), void checkRange(int start, int count), int ComputeHashCode(ISequenced<T> items, IHasher<T> itemhasher), void CopyTo(T[] a, int i), bool Equals(object obj), bool Exists(Filter<T> filter), void Finalize(), System.Collections.Generic.IEnumerator<T> GetEnumerator(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), void modifycheck(int thestamp), bool sequencedequals(ISequenced<T> that), int sequencedhashcode(), bool StaticEquals(ISequenced<T> tit, ISequenced<T> tat, IHasher<T> itemhasher), T[] ToArray(), string ToString(), bool unsequencedequals(ICollection<T> that), int unsequencedhashcode(), void updatecheck()

Field details

Pbool isReadOnly Inherited from CollectionBase{T}: bool isReadOnly
Pint stamp Inherited from CollectionBase{T}: int stamp
Pint size Inherited from CollectionBase{T}: int size
PIHasher<T> itemhasher Inherited from CollectionBase{T}: IHasher<T> itemhasher

Property details

EnumerationDirection Direction Value: The enumeration direction relative to the original collection. Forwards if same, else Backwards
bool IsReadOnly Inherited from CollectionBase{T}: bool IsReadOnly
int Count Inherited from CollectionBase{T}: int Count
Speed CountSpeed Inherited from CollectionBase{T}: Speed CountSpeed
object SyncRoot Inherited from CollectionBase{T}: object SyncRoot
bool IsEmpty Inherited from CollectionBase{T}: bool IsEmpty

Constructor details

PSequencedBase<T>()

Method details

NSint ComputeHashCode(ISequenced<T> items, IHasher<T> itemhasher) Compute the unsequenced hash code of a collection
Returns: The hash code
items: The collection to compute hash code for
itemhasher: The item hasher
NSbool StaticEquals(ISequenced<T> tit, ISequenced<T> tat, IHasher<T> itemhasher) Examine if tit and tat are equal as sequenced collections using the specified item hasher (assumed compatible with the two collections).
Returns: True if equal
tit: The first collection
tat: The second collection
itemhasher: The item hasher to use for comparison
NPint sequencedhashcode() Get the sequenced collection hash code of this collection: from the cached value if present and up to date, else (re)compute.
Returns: The hash code
NPbool sequencedequals(ISequenced<T> that) Check if the contents of that is equal to the contents of this in the sequenced sense. Using the item hasher of this collection.
Returns: True if equal
that: The collection to compare to.
System.Collections.Generic.IEnumerator<T> GetEnumerator() Create an enumerator for this collection.
Returns: The enumerator
NPvoid checkRange(int start, int count) Inherited from CollectionBase{T}: void checkRange(int start, int count)
NPint unsequencedhashcode() Inherited from CollectionBase{T}: int unsequencedhashcode()
NPbool unsequencedequals(ICollection<T> that) Inherited from CollectionBase{T}: bool unsequencedequals(ICollection<T> that)
Pvoid modifycheck(int thestamp) Inherited from CollectionBase{T}: void modifycheck(int thestamp)
Pvoid updatecheck() Inherited from CollectionBase{T}: void updatecheck()
void CopyTo(T[] a, int i) Inherited from CollectionValueBase{T}: void CopyTo(T[] a, int i)
T[] ToArray() Inherited from CollectionValueBase{T}: T[] ToArray()
void Apply(Applier<T> a) Inherited from CollectionValueBase{T}: void Apply(Applier<T> a)
bool Exists(Filter<T> filter) Inherited from CollectionValueBase{T}: bool Exists(Filter<T> filter)
bool All(Filter<T> filter) Inherited from CollectionValueBase{T}: bool All(Filter<T> filter)
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class ArrayBase<T>

Base class for collection classes of dynamic array type implementations.

Implements

System.Collections.Generic.IEnumerable<T>, ICollectionValue<T>

Bases

object, EnumerableBase<T>, CollectionValueBase<T>, CollectionBase<T>, SequencedBase<T>

Base of

ArrayList<T>, HashedArrayList<T>, SortedArray<T>

Field overview

T[] array, bool isReadOnly, IHasher<T> itemhasher, int offset, int size, int stamp

Property overview

int Count, Speed CountSpeed, EnumerationDirection Direction, bool IsEmpty, bool IsReadOnly, IDirectedCollectionValue<T> this[int start, int count], object SyncRoot

Constructor overview

ArrayBase<T>(int capacity, IHasher<T> hasher)

Method overview

bool All(Filter<T> filter), void Apply(Applier<T> a), IDirectedCollectionValue<T> Backwards(), bool Check(), void checkRange(int start, int count), void Clear(), void CopyTo(T[] a, int i), bool Equals(object obj), bool Exists(Filter<T> filter), void expand(), void expand(int newcapacity, int newsize), void Finalize(), System.Collections.Generic.IEnumerator<T> GetEnumerator(), int GetHashCode(), System.Type GetType(), void insert(int i, T item), object MemberwiseClone(), void modifycheck(int thestamp), bool sequencedequals(ISequenced<T> that), int sequencedhashcode(), T[] ToArray(), string ToString(), bool unsequencedequals(ICollection<T> that), int unsequencedhashcode(), void updatecheck()

Field details

PT[] array The actual internal array container. Will be extended on demand.
Pint offset The offset into the internal array container of the first item. The offset is 0 for a base dynamic array and may be positive for an updatable view into a base dynamic array.
Pbool isReadOnly Inherited from CollectionBase{T}: bool isReadOnly
Pint stamp Inherited from CollectionBase{T}: int stamp
Pint size Inherited from CollectionBase{T}: int size
PIHasher<T> itemhasher Inherited from CollectionBase{T}: IHasher<T> itemhasher

Property details

IDirectedCollectionValue<T> this[int start, int count] Value: The directed collection of items in a specific index interval.
Throws System.IndexOutOfRangeException.
start: The low index of the interval (inclusive).
count: The size of the range.
EnumerationDirection Direction Inherited from SequencedBase{T}: EnumerationDirection Direction
bool IsReadOnly Inherited from CollectionBase{T}: bool IsReadOnly
int Count Inherited from CollectionBase{T}: int Count
Speed CountSpeed Inherited from CollectionBase{T}: Speed CountSpeed
object SyncRoot Inherited from CollectionBase{T}: object SyncRoot
bool IsEmpty Inherited from CollectionBase{T}: bool IsEmpty

Constructor details

ArrayBase<T>(int capacity, IHasher<T> hasher) Create an empty ArrayBase object.
capacity: The initial capacity of the internal array container. Will be rounded upwards to the nearest power of 2 greater than or equal to 8.
hasher: The item hasher to use, primarily for item equality

Method details

Pvoid expand() Double the size of the internal array.
Pvoid expand(int newcapacity, int newsize) Expand the internal array container.
newcapacity: The new size of the internal array - will be rounded upwards to a power of 2.
newsize: The (new) size of the (base) collection.
Pvoid insert(int i, T item) Insert an item at a specific index, moving items to the right upwards and expanding the array if necessary.
i: The index at which to insert.
item: The item to insert.
void Clear() Remove all items and reset size of internal array container.
T[] ToArray() Create an array containing (copies) of the items of this collection in enumeration order.
Returns: The new array
bool Check() Perform an internal consistency (invariant) test on the array base.
Returns: True if test succeeds.
IDirectedCollectionValue<T> Backwards() Create a directed collection with the same contents as this one, but opposite enumeration sequence.
Returns: The mirrored collection.
System.Collections.Generic.IEnumerator<T> GetEnumerator() Create an enumerator for this array based collection.
Returns: The enumerator
NPint sequencedhashcode() Inherited from SequencedBase{T}: int sequencedhashcode()
NPbool sequencedequals(ISequenced<T> that) Inherited from SequencedBase{T}: bool sequencedequals(ISequenced<T> that)
NPvoid checkRange(int start, int count) Inherited from CollectionBase{T}: void checkRange(int start, int count)
NPint unsequencedhashcode() Inherited from CollectionBase{T}: int unsequencedhashcode()
NPbool unsequencedequals(ICollection<T> that) Inherited from CollectionBase{T}: bool unsequencedequals(ICollection<T> that)
Pvoid modifycheck(int thestamp) Inherited from CollectionBase{T}: void modifycheck(int thestamp)
Pvoid updatecheck() Inherited from CollectionBase{T}: void updatecheck()
void CopyTo(T[] a, int i) Inherited from CollectionValueBase{T}: void CopyTo(T[] a, int i)
void Apply(Applier<T> a) Inherited from CollectionValueBase{T}: void Apply(Applier<T> a)
bool Exists(Filter<T> filter) Inherited from CollectionValueBase{T}: bool Exists(Filter<T> filter)
bool All(Filter<T> filter) Inherited from CollectionValueBase{T}: bool All(Filter<T> filter)
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class ArrayList<T>

A list collection based on a plain dynamic array data structure. Expansion of the internal array is performed by doubling on demand. The internal array is only shrinked by the Clear method.

When the FIFO property is set to false this class works fine as a stack of T. When the FIFO property is set to true the class will function as a (FIFO) queue but very inefficiently, use a LinkedList (See ) instead.

Implements

System.Collections.Generic.IEnumerable<T>, ICollection<T>, ICollectionValue<T>, IDirectedCollectionValue<T>, IDirectedEnumerable<T>, IExtensible<T>, IIndexed<T>, IList<T>, IQueue<T>, ISequenced<T>, IStack<T>

Bases

object, EnumerableBase<T>, CollectionValueBase<T>, CollectionBase<T>, SequencedBase<T>, ArrayBase<T>

Base of

HashedArrayList<T>

Field overview

T[] array, bool fIFO, bool isReadOnly, IHasher<T> itemhasher, int offset, int size, int stamp, ArrayList<T> underlying, int underlyingsize

Property overview

bool AllowsDuplicates, Speed ContainsSpeed, int Count, Speed CountSpeed, EnumerationDirection Direction, bool FIFO, T First, bool IsEmpty, bool IsReadOnly, T this[int i], IDirectedCollectionValue<T> this[int start, int count], T Last, int Offset, object SyncRoot, IList<T> Underlying

Constructor overview

ArrayList<T>(), ArrayList<T>(IHasher<T> hasher), ArrayList<T>(int capacity), ArrayList<T>(int capacity, IHasher<T> hasher)

Method overview

bool Add(T item), void AddAll(System.Collections.Generic.IEnumerable<T> items), void addtosize(int delta), bool All(Filter<T> filter), void Apply(Applier<T> a), IDirectedCollectionValue<T> Backwards(), bool Check(), void checkRange(int start, int count), void Clear(), bool Contains(T item), bool ContainsAll(System.Collections.Generic.IEnumerable<T> items), int ContainsCount(T item), void CopyTo(T[] a, int i), T DeQueue(), void EnQueue(T item), bool Equals(object obj), bool Exists(Filter<T> filter), void expand(), void expand(int newcapacity, int newsize), void Finalize(), bool Find(ref T item), IList<T> FindAll(Filter<T> filter), bool FindOrAdd(ref T item), System.Collections.Generic.IEnumerator<T> GetEnumerator(), int GetHashCode(), System.Type GetType(), int indexOf(T item), int IndexOf(T item), void insert(int i, T item), void Insert(int i, T item), void InsertAfter(T item, T target), void InsertAll(int i, System.Collections.Generic.IEnumerable<T> items), void InsertBefore(T item, T target), void InsertFirst(T item), void InsertLast(T item), bool IsSorted(IComparer<T> c), int lastIndexOf(T item), int LastIndexOf(T item), IList<V> Map<V>(Mapper<T,V> mapper), IList<V> Map<V>(Mapper<T,V> mapper, IHasher<V> hasher), object MemberwiseClone(), void modifycheck(), void modifycheck(int stamp), T Pop(), void Push(T item), T Remove(), bool Remove(T item), void RemoveAll(System.Collections.Generic.IEnumerable<T> items), void RemoveAllCopies(T item), T removeAt(int i), T RemoveAt(int i), T RemoveFirst(), void RemoveInterval(int start, int count), T RemoveLast(), bool RemoveWithReturn(ref T item), void RetainAll(System.Collections.Generic.IEnumerable<T> items), void Reverse(), void Reverse(int start, int count), bool sequencedequals(ISequenced<T> that), int sequencedhashcode(), void Shuffle(), void Shuffle(System.Random rnd), void Slide(int offset), void Slide(int offset, int size), void Sort(IComparer<T> c), T[] ToArray(), string ToString(), bool unsequencedequals(ICollection<T> that), int unsequencedhashcode(), bool Update(T item), void updatecheck(), bool UpdateOrAdd(T item), IList<T> View(int start, int count)

Field details

PArrayList<T> underlying The underlying list if we are a view, null else.
Pint underlyingsize The size of the underlying list.
Pbool fIFO The underlying field of the FIFO property
PT[] array Inherited from ArrayBase{T}: T[] array
Pint offset Inherited from ArrayBase{T}: int offset
Pbool isReadOnly Inherited from CollectionBase{T}: bool isReadOnly
Pint stamp Inherited from CollectionBase{T}: int stamp
Pint size Inherited from CollectionBase{T}: int size
PIHasher<T> itemhasher Inherited from CollectionBase{T}: IHasher<T> itemhasher

Property details

T First Value: The first item in this list.
Throws System.InvalidOperationException if this list is empty.
T Last Value: The last item in this list.
Throws System.InvalidOperationException if this list is empty.
bool FIFO Value: True if the Remove() operation removes from the start of the list, false if it removes from the end.Since Add(T item) always add at the end of the list, this describes if list has FIFO or LIFO semantics.
T this[int i] Value: The i'th item of this list.On this list, this indexer is read/write.
Throws System.IndexOutOfRangeException if i is negative or >= the size of the collection.
i: The index of the item to fetch or store.
IList<T> Underlying Value: Underlying list for view.Null if this list is not a view.
int Offset Value: Offset for this list view or 0 for an underlying list.
Speed ContainsSpeed Value: Speed.LinearThe value is symbolic indicating the type of asymptotic complexity in terms of the size of this collection (worst-case or amortized as relevant).
bool AllowsDuplicates Value: True, indicating array list has bag semantics.
IDirectedCollectionValue<T> this[int start, int count] Inherited from ArrayBase{T}: IDirectedCollectionValue<T> this[int start, int count]
EnumerationDirection Direction Inherited from SequencedBase{T}: EnumerationDirection Direction
bool IsReadOnly Inherited from CollectionBase{T}: bool IsReadOnly
int Count Inherited from CollectionBase{T}: int Count
Speed CountSpeed Inherited from CollectionBase{T}: Speed CountSpeed
object SyncRoot Inherited from CollectionBase{T}: object SyncRoot
bool IsEmpty Inherited from CollectionBase{T}: bool IsEmpty

Constructor details

ArrayList<T>() Create an array list with default item hasher and initial capacity 8 items.
ArrayList<T>(IHasher<T> hasher) Create an array list with external item hasher and initial capacity 8 items.
hasher: The external hasher
ArrayList<T>(int capacity) Create an array list with default item hasher and prescribed initial capacity.
capacity: The prescribed capacity
ArrayList<T>(int capacity, IHasher<T> hasher) Create an array list with external item hasher and prescribed initial capacity.
capacity: The prescribed capacity
hasher: The external hasher

Method details

IList<V> Map<V>(Mapper<T,V> mapper) Create a new list consisting of the results of mapping all items of this list. The new list will use the default hasher for the item type V.
Returns: The new list.
mapper: The delegate defining the map.
IList<V> Map<V>(Mapper<T,V> mapper, IHasher<V> hasher) Create a new list consisting of the results of mapping all items of this list. The new list will use a specified hasher for the item type.
Returns: The new list.
mapper: The delegate defining the map.
hasher: The hasher to use for the new list
Pvoid expand() Double the size of the internal array.
Pvoid expand(int newcapacity, int newsize) Expand the internal array, resetting the index of the first unused element.
newcapacity: The new capacity (will be rouded upwards to a power of 2).
newsize: The new count of
Pvoid updatecheck() Check if it is valid to perform updates and increment stamp.
Throws System.InvalidOperationException if check fails.
NPvoid modifycheck() Check if we are a view that the underlying list has only been updated through us.
Throws System.InvalidOperationException if check fails.
This method should be called from enumerators etc to guard against modification of the base collection.
Pvoid modifycheck(int stamp) Check that the list has not been updated since a particular time.
Throws System.InvalidOperationException if check fails.
stamp: The stamp indicating the time.
NPvoid addtosize(int delta) Increment or decrement the private size fields
delta: Increment (with sign)
Pint indexOf(T item) Internal version of IndexOf without modification checks.
Returns: The index of first occurrence
item: Item to look for
Pint lastIndexOf(T item) Internal version of LastIndexOf without modification checks.
Returns: The index of last occurrence
item: Item to look for
Pvoid insert(int i, T item) Internal version of Insert with no modification checks.
i: Index to insert at
item: Item to insert
PT removeAt(int i) Internal version of RemoveAt with no modification checks.
Returns: The removed item
i: Index to remove at
void Insert(int i, T item) Insert an item at a specific index location in this list.
Throws System.IndexOutOfRangeException if i is negative or > the size of the collection.
i: The index at which to insert.
item: The item to insert.
void InsertAll(int i, System.Collections.Generic.IEnumerable<T> items) Insert into this list all items from an enumerable collection starting at a particular index.
Throws System.IndexOutOfRangeException if i is negative or > the size of the collection.
i: Index to start inserting at
items: Items to insert
void InsertBefore(T item, T target) Insert an item right before the first occurrence of some target item.
Throws System.ArgumentException if target is not found.
item: The item to insert.
target: The target before which to insert.
void InsertAfter(T item, T target) Insert an item right after the last(???) occurrence of some target item.
Throws System.ArgumentException if target is not found.
item: The item to insert.
target: The target after which to insert.
void InsertFirst(T item) Insert an item at the front of this list;
item: The item to insert.
void InsertLast(T item) Insert an item at the back of this list.
item: The item to insert.
IList<T> FindAll(Filter<T> filter) Create a new list consisting of the items of this list satisfying a certain predicate.
Returns: The new list.
filter: The filter delegate defining the predicate.
T Remove() Remove one item from the list: from the front if FIFO is true, else from the back.
Throws System.InvalidOperationException if this list is empty.
Returns: The removed item.
T RemoveFirst() Remove one item from the fromnt of the list.
Throws System.InvalidOperationException if this list is empty.
Returns: The removed item.
T RemoveLast() Remove one item from the back of the list.
Returns: The removed item.
IList<T> View(int start, int count) Create a list view on this list.
Throws System.ArgumentOutOfRangeException if the start or count is negative
Throws System.ArgumentException if the range does not fit within list.
Returns: The new list view.
start: The index in this list of the start of the view.
count: The size of the view.
void Slide(int offset) Slide this list view along the underlying list.
Throws System.InvalidOperationException if this list is not a view.
Throws System.ArgumentOutOfRangeException if the operation would bring either end of the view outside the underlying list.
offset: The signed amount to slide: positive to slide towards the end.
void Slide(int offset, int size) Slide this list view along the underlying list, changing its size.
Throws System.InvalidOperationException if this list is not a view.
Throws System.ArgumentOutOfRangeException if the operation would bring either end of the view outside the underlying list.
offset: The signed amount to slide: positive to slide towards the end.
size: The new size of the view.
void Reverse() Reverst the list so the items are in the opposite sequence order.
void Reverse(int start, int count) Reverst part of the list so the items are in the opposite sequence order.
Throws System.ArgumentException if the count is negative.
Throws System.ArgumentOutOfRangeException if the part does not fit into the list.
start: The index of the start of the part to reverse.
count: The size of the part to reverse.
bool IsSorted(IComparer<T> c) Check if this list is sorted according to a specific sorting order.
Returns: True if the list is sorted, else false.
c: The comparer defining the sorting order.
void Sort(IComparer<T> c) Sort the items of the list according to a specific sorting order.
c: The comparer defining the sorting order.
void Shuffle() Randonmly shuffle the items of this list.
void Shuffle(System.Random rnd) Shuffle the items of this list according to a specific random source.
rnd: The random source.
int IndexOf(T item) Search for an item in the list going forwrds from the start.
Returns: Index of item from start.
item: Item to search for.
int LastIndexOf(T item) Search for an item in the list going backwords from the end.
Returns: Index of of item from the end.
item: Item to search for.
T RemoveAt(int i) Remove the item at a specific position of the list.
Throws System.IndexOutOfRangeException if i is negative or >= the size of the collection.
Returns: The removed item.
i: The index of the item to remove.
void RemoveInterval(int start, int count) Remove all items in an index interval.
Throws System.IndexOutOfRangeException???.
start: The index of the first item to remove.
count: The number of items to remove.
bool Contains(T item) Check if this collection contains (an item equivalent to according to the itemhasher) a particular value.
Returns: True if the items is in this collection.
item: The value to check for.
bool Find(ref T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, return in the ref argument (a binary copy of) the actual value found.
Returns: True if the items is in this collection.
item: The value to look for.
bool Update(T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, update the item in the collection to with a binary copy of the supplied value. This will only update the first mathching item.
Returns: True if the item was found and hence updated.
item: Value to update.
bool FindOrAdd(ref T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, return in the ref argument (a binary copy of) the actual value found. Else, add the item to the collection.
Returns: True if the item was found (hence not added).
item: The value to look for.
bool UpdateOrAdd(T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, update the item in the collection to with a binary copy of the supplied value. This will only update the first mathching item.
Returns: True if the item was found and hence updated.
item: Value to update.
bool Remove(T item) Remove the first copy of a particular item from this collection.
Returns: True if the item was found (and removed).
item: The value to remove.
bool RemoveWithReturn(ref T item) Remove the first copy of a particular item from this collection if found. If an item was removed, report a binary copy of the actual item removed in the argument.
Returns: True if the item was found (and removed).
item: The value to remove on input.
void RemoveAll(System.Collections.Generic.IEnumerable<T> items) Remove all items in another collection from this one, taking multiplicities into account. Matching items will be removed from the front. Current implementation is not optimal.
items: The items to remove.
void Clear() Remove all items from this collection, resetting internal array size.
void RetainAll(System.Collections.Generic.IEnumerable<T> items) Remove all items not in some other collection from this one, taking multiplicities into account. Items are retained front first. Current implementation is not optimal.
items: The items to retain.
bool ContainsAll(System.Collections.Generic.IEnumerable<T> items) Check if this collection contains all the values in another collection, taking multiplicities into account. Current implementation is not optimal.
Returns: True if all values in itemsis in this collection.
items: The
int ContainsCount(T item) Count the number of items of the collection equal to a particular value. Returns 0 if and only if the value is not in the collection.
Returns: The number of copies found.
item: The value to count.
void RemoveAllCopies(T item) Remove all items equal to a given one.
item: The value to remove.
bool Check() Check the integrity of the internal data structures of this array list.
Returns: True if check does not fail.
bool Add(T item) Add an item to end of this list.
Returns: True
item: The item to add.
void AddAll(System.Collections.Generic.IEnumerable<T> items) Add the elements from another collection to this collection.
items: The items to add.
void Push(T item) Push an item to the top of the stack.
item: The item
T Pop() Pop the item at the top of the stack from the stack.
Returns: The popped item.
void EnQueue(T item) Enqueue an item at the back of the queue.
item: The item
T DeQueue() Dequeue an item from the front of the queue.
Returns: The item
T[] ToArray() Inherited from ArrayBase{T}: T[] ToArray()
IDirectedCollectionValue<T> Backwards() Inherited from ArrayBase{T}: IDirectedCollectionValue<T> Backwards()
System.Collections.Generic.IEnumerator<T> GetEnumerator() Inherited from ArrayBase{T}: System.Collections.Generic.IEnumerator<T> GetEnumerator()
NPint sequencedhashcode() Inherited from SequencedBase{T}: int sequencedhashcode()
NPbool sequencedequals(ISequenced<T> that) Inherited from SequencedBase{T}: bool sequencedequals(ISequenced<T> that)
NPvoid checkRange(int start, int count) Inherited from CollectionBase{T}: void checkRange(int start, int count)
NPint unsequencedhashcode() Inherited from CollectionBase{T}: int unsequencedhashcode()
NPbool unsequencedequals(ICollection<T> that) Inherited from CollectionBase{T}: bool unsequencedequals(ICollection<T> that)
void CopyTo(T[] a, int i) Inherited from CollectionValueBase{T}: void CopyTo(T[] a, int i)
void Apply(Applier<T> a) Inherited from CollectionValueBase{T}: void Apply(Applier<T> a)
bool Exists(Filter<T> filter) Inherited from CollectionValueBase{T}: bool Exists(Filter<T> filter)
bool All(Filter<T> filter) Inherited from CollectionValueBase{T}: bool All(Filter<T> filter)
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class GuardedEnumerator<T>

A read-only wrapper class for a generic enumerator

Implements

System.Collections.Generic.IEnumerator<T>, System.IDisposable

Bases

object

Property overview

T Current

Constructor overview

GuardedEnumerator<T>(System.Collections.Generic.IEnumerator<T> enumerator)

Method overview

void Dispose(), bool Equals(object obj), void Finalize(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), bool MoveNext(), string ToString()

Property details

T Current Value: The current item of the wrapped enumerator.Undefined if enumerator is not valid (MoveNext hash been called returning true)

Constructor details

GuardedEnumerator<T>(System.Collections.Generic.IEnumerator<T> enumerator) Create a wrapper around a generic enumerator
enumerator: The enumerator to wrap

Method details

bool MoveNext() Move wrapped enumerator to next item, or the first item if this is the first call to MoveNext.
Returns: True if enumerator is valid now
void Dispose() Dispose wrapped enumerator
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class GuardedEnumerable<T>

A read-only wrapper class for a generic enumerable

This is mainly interesting as a base of other guard classes

Implements

System.Collections.Generic.IEnumerable<T>

Bases

object

Base of

GuardedCollection<T>, GuardedCollectionValue<T>, GuardedDictionary<K,V>, GuardedDirectedCollectionValue<T>, GuardedDirectedEnumerable<T>, GuardedIndexedSorted<T>, GuardedList<T>, GuardedSequenced<T>, GuardedSorted<T>, GuardedSortedDictionary<K,V>

Constructor overview

GuardedEnumerable<T>(System.Collections.Generic.IEnumerable<T> enumerable)

Method overview

bool Equals(object obj), void Finalize(), System.Collections.Generic.IEnumerator<T> GetEnumerator(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), string ToString()

Constructor details

GuardedEnumerable<T>(System.Collections.Generic.IEnumerable<T> enumerable) Wrap an enumerable in a read-only wrapper
enumerable: The enumerable to wrap

Method details

System.Collections.Generic.IEnumerator<T> GetEnumerator() Get an enumerator from the wrapped enumerable
Returns: The enumerator (itself wrapped)
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class GuardedDirectedEnumerable<T>

A read-only wrapper for a generic directed enumerable

This is mainly interesting as a base of other guard classes

Implements

System.Collections.Generic.IEnumerable<T>, IDirectedEnumerable<T>

Bases

object, GuardedEnumerable<T>

Property overview

EnumerationDirection Direction

Constructor overview

GuardedDirectedEnumerable<T>(IDirectedEnumerable<T> directedenumerable)

Method overview

IDirectedEnumerable<T> Backwards(), bool Equals(object obj), void Finalize(), System.Collections.Generic.IEnumerator<T> GetEnumerator(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), string ToString()

Property details

EnumerationDirection Direction Value: The enumeration direction relative to the original collection. Forwards if same, else Backwards

Constructor details

GuardedDirectedEnumerable<T>(IDirectedEnumerable<T> directedenumerable) Wrap a directed enumerable in a read-only wrapper
directedenumerable: the collection to wrap

Method details

IDirectedEnumerable<T> Backwards() Get a enumerable that enumerates the wrapped collection in the opposite direction
Returns: The mirrored enumerable
System.Collections.Generic.IEnumerator<T> GetEnumerator() Inherited from GuardedEnumerable{T}: System.Collections.Generic.IEnumerator<T> GetEnumerator()
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class GuardedCollectionValue<T>

A read-only wrapper for an ICollectionValue<T>

This is mainly interesting as a base of other guard classes

Implements

System.Collections.Generic.IEnumerable<T>, ICollectionValue<T>

Bases

object, GuardedEnumerable<T>

Base of

GuardedCollection<T>, GuardedDirectedCollectionValue<T>, GuardedIndexedSorted<T>, GuardedList<T>, GuardedSequenced<T>, GuardedSorted<T>

Property overview

int Count, Speed CountSpeed

Constructor overview

GuardedCollectionValue<T>(ICollectionValue<T> collection)

Method overview

bool All(Filter<T> filter), void Apply(Applier<T> a), void CopyTo(T[] a, int i), bool Equals(object obj), bool Exists(Filter<T> filter), void Finalize(), System.Collections.Generic.IEnumerator<T> GetEnumerator(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), T[] ToArray(), string ToString()

Property details

int Count Value: The sizeGet the size of the wrapped collection
Speed CountSpeed Value: A characterization of the speed of the Count property in this collection.The value is symbolic indicating the type of asymptotic complexity in terms of the size of this collection (worst-case or amortized as relevant).

Constructor details

GuardedCollectionValue<T>(ICollectionValue<T> collection) Wrap a ICollectionValue<T> in a read-only wrapper
collection: the collection to wrap

Method details

void CopyTo(T[] a, int i) Copy the items of the wrapped collection to an array
a: The array
i: Starting offset
T[] ToArray() Create an array from the items of the wrapped collection
Returns: The array
void Apply(Applier<T> a) Apply a delegate to all items of the wrapped enumerable.
a: The delegate to apply
bool Exists(Filter<T> filter) Check if there exists an item that satisfies a specific predicate in the wrapped enumerable.
Returns: True is such an item exists
filter: A filter delegate (See ) defining the predicate
bool All(Filter<T> filter) Check if all items in the wrapped enumerable satisfies a specific predicate.
Returns: True if all items satisfies the predicate
filter: A filter delegate (See ) defining the predicate
System.Collections.Generic.IEnumerator<T> GetEnumerator() Inherited from GuardedEnumerable{T}: System.Collections.Generic.IEnumerator<T> GetEnumerator()
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class GuardedDirectedCollectionValue<T>

A read-only wrapper for a directed collection

This is mainly interesting as a base of other guard classes

Implements

System.Collections.Generic.IEnumerable<T>, ICollectionValue<T>, IDirectedCollectionValue<T>, IDirectedEnumerable<T>

Bases

object, GuardedEnumerable<T>, GuardedCollectionValue<T>

Property overview

int Count, Speed CountSpeed, EnumerationDirection Direction

Constructor overview

GuardedDirectedCollectionValue<T>(IDirectedCollectionValue<T> directedcollection)

Method overview

bool All(Filter<T> filter), void Apply(Applier<T> a), IDirectedCollectionValue<T> Backwards(), void CopyTo(T[] a, int i), bool Equals(object obj), bool Exists(Filter<T> filter), void Finalize(), System.Collections.Generic.IEnumerator<T> GetEnumerator(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), T[] ToArray(), string ToString()

Property details

EnumerationDirection Direction Value: The enumeration direction relative to the original collection. Forwards if same, else Backwards
int Count Inherited from GuardedCollectionValue{T}: int Count
Speed CountSpeed Inherited from GuardedCollectionValue{T}: Speed CountSpeed

Constructor details

GuardedDirectedCollectionValue<T>(IDirectedCollectionValue<T> directedcollection) Wrap a directed collection in a read-only wrapper
directedcollection: the collection to wrap

Method details

IDirectedCollectionValue<T> Backwards() Get a collection that enumerates the wrapped collection in the opposite direction
Returns: The mirrored collection
void CopyTo(T[] a, int i) Inherited from GuardedCollectionValue{T}: void CopyTo(T[] a, int i)
T[] ToArray() Inherited from GuardedCollectionValue{T}: T[] ToArray()
void Apply(Applier<T> a) Inherited from GuardedCollectionValue{T}: void Apply(Applier<T> a)
bool Exists(Filter<T> filter) Inherited from GuardedCollectionValue{T}: bool Exists(Filter<T> filter)
bool All(Filter<T> filter) Inherited from GuardedCollectionValue{T}: bool All(Filter<T> filter)
System.Collections.Generic.IEnumerator<T> GetEnumerator() Inherited from GuardedEnumerable{T}: System.Collections.Generic.IEnumerator<T> GetEnumerator()
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class GuardedCollection<T>

A read-only wrapper for an ICollection<T>. See

Suitable for wrapping hash tables, See and See

Implements

System.Collections.Generic.IEnumerable<T>, ICollection<T>, ICollectionValue<T>, IExtensible<T>

Bases

object, GuardedEnumerable<T>, GuardedCollectionValue<T>

Base of

GuardedIndexedSorted<T>, GuardedList<T>, GuardedSequenced<T>, GuardedSorted<T>

Property overview

bool AllowsDuplicates, Speed ContainsSpeed, int Count, Speed CountSpeed, bool IsEmpty, bool IsReadOnly, object SyncRoot

Constructor overview

GuardedCollection<T>(ICollection<T> collection)

Method overview

bool Add(T item), void AddAll(System.Collections.Generic.IEnumerable<T> items), bool All(Filter<T> filter), void Apply(Applier<T> a), bool Check(), void Clear(), bool Contains(T item), bool ContainsAll(System.Collections.Generic.IEnumerable<T> items), int ContainsCount(T item), void CopyTo(T[] a, int i), bool Equals(object obj), bool Exists(Filter<T> filter), void Finalize(), bool Find(ref T item), bool FindOrAdd(ref T item), System.Collections.Generic.IEnumerator<T> GetEnumerator(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), bool Remove(T item), void RemoveAll(System.Collections.Generic.IEnumerable<T> items), void RemoveAllCopies(T item), bool RemoveWithReturn(ref T item), void RetainAll(System.Collections.Generic.IEnumerable<T> items), T[] ToArray(), string ToString(), bool Update(T item), bool UpdateOrAdd(T item)

Property details

bool IsReadOnly Value: True(This is a read-only wrapper)
Speed ContainsSpeed Value: Speed of wrapped collection
bool AllowsDuplicates Value: False if wrapped collection has set semantics
object SyncRoot Value: The sync root of the wrapped collection
bool IsEmpty Value: True if wrapped collection is empty
int Count Inherited from GuardedCollectionValue{T}: int Count
Speed CountSpeed Inherited from GuardedCollectionValue{T}: Speed CountSpeed

Constructor details

GuardedCollection<T>(ICollection<T> collection) Wrap an ICollection<T> in a read-only wrapper
collection: the collection to wrap

Method details

bool Contains(T item) Check if an item is in the wrapped collection
Returns: True if found
item: The item
int ContainsCount(T item) Count the number of times an item appears in the wrapped collection
Returns: The number of copies
item: The item
bool ContainsAll(System.Collections.Generic.IEnumerable<T> items) Check if all items in the argument is in the wrapped collection
Returns: True if so
items: The items
bool Find(ref T item) Search for an item in the wrapped collection
Returns:
item: On entry the item to look for, on exit the equivalent item found (if any)
bool FindOrAdd(ref T item)
Throws System.InvalidOperationException since this is a read-only wrappper
Returns:
item:
bool Update(T item)
Throws System.InvalidOperationException since this is a read-only wrappper
Returns:
item:
bool UpdateOrAdd(T item)
Throws System.InvalidOperationException since this is a read-only wrappper
Returns:
item:
bool Remove(T item)
Throws System.InvalidOperationException since this is a read-only wrappper
Returns:
item:
bool RemoveWithReturn(ref T item)
Throws System.InvalidOperationException since this is a read-only wrappper
Returns:
item:
void RemoveAllCopies(T item)
Throws System.InvalidOperationException since this is a read-only wrappper
item:
void RemoveAll(System.Collections.Generic.IEnumerable<T> items)
Throws System.InvalidOperationException since this is a read-only wrappper
items:
void Clear()
Throws System.InvalidOperationException since this is a read-only wrappper
void RetainAll(System.Collections.Generic.IEnumerable<T> items)
Throws System.InvalidOperationException since this is a read-only wrappper
items:
bool Check() Check wrapped collection for internal consistency
Returns: True if check passed
bool Add(T item)
Throws System.InvalidOperationException since this is a read-only wrappper
Returns:
item:
void AddAll(System.Collections.Generic.IEnumerable<T> items)
Throws System.InvalidOperationException since this is a read-only wrappper
items:
void CopyTo(T[] a, int i) Inherited from GuardedCollectionValue{T}: void CopyTo(T[] a, int i)
T[] ToArray() Inherited from GuardedCollectionValue{T}: T[] ToArray()
void Apply(Applier<T> a) Inherited from GuardedCollectionValue{T}: void Apply(Applier<T> a)
bool Exists(Filter<T> filter) Inherited from GuardedCollectionValue{T}: bool Exists(Filter<T> filter)
bool All(Filter<T> filter) Inherited from GuardedCollectionValue{T}: bool All(Filter<T> filter)
System.Collections.Generic.IEnumerator<T> GetEnumerator() Inherited from GuardedEnumerable{T}: System.Collections.Generic.IEnumerator<T> GetEnumerator()
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class GuardedSequenced<T>

A read-only wrapper for a sequenced collection

This is mainly interesting as a base of other guard classes

Implements

System.Collections.Generic.IEnumerable<T>, ICollection<T>, ICollectionValue<T>, IDirectedCollectionValue<T>, IDirectedEnumerable<T>, IExtensible<T>, ISequenced<T>

Bases

object, GuardedEnumerable<T>, GuardedCollectionValue<T>, GuardedCollection<T>

Base of

GuardedIndexedSorted<T>, GuardedList<T>, GuardedSorted<T>

Property overview

bool AllowsDuplicates, Speed ContainsSpeed, int Count, Speed CountSpeed, EnumerationDirection Direction, bool IsEmpty, bool IsReadOnly, object SyncRoot

Constructor overview

GuardedSequenced<T>(ISequenced<T> sorted)

Method overview

bool Add(T item), void AddAll(System.Collections.Generic.IEnumerable<T> items), bool All(Filter<T> filter), void Apply(Applier<T> a), IDirectedCollectionValue<T> Backwards(), bool Check(), void Clear(), bool Contains(T item), bool ContainsAll(System.Collections.Generic.IEnumerable<T> items), int ContainsCount(T item), void CopyTo(T[] a, int i), bool Equals(object obj), bool Exists(Filter<T> filter), void Finalize(), bool Find(ref T item), bool FindOrAdd(ref T item), System.Collections.Generic.IEnumerator<T> GetEnumerator(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), bool Remove(T item), void RemoveAll(System.Collections.Generic.IEnumerable<T> items), void RemoveAllCopies(T item), bool RemoveWithReturn(ref T item), void RetainAll(System.Collections.Generic.IEnumerable<T> items), T[] ToArray(), string ToString(), bool Update(T item), bool UpdateOrAdd(T item)

Property details

EnumerationDirection Direction Value: The enumeration direction relative to the original collection. Forwards if same, else Backwards
bool IsReadOnly Inherited from GuardedCollection{T}: bool IsReadOnly
Speed ContainsSpeed Inherited from GuardedCollection{T}: Speed ContainsSpeed
bool AllowsDuplicates Inherited from GuardedCollection{T}: bool AllowsDuplicates
object SyncRoot Inherited from GuardedCollection{T}: object SyncRoot
bool IsEmpty Inherited from GuardedCollection{T}: bool IsEmpty
int Count Inherited from GuardedCollectionValue{T}: int Count
Speed CountSpeed Inherited from GuardedCollectionValue{T}: Speed CountSpeed

Constructor details

GuardedSequenced<T>(ISequenced<T> sorted) Wrap a sequenced collection in a read-only wrapper
sorted:

Method details

IDirectedCollectionValue<T> Backwards() Get a collection that enumerates the wrapped collection in the opposite direction
Returns: The mirrored collection
bool Contains(T item) Inherited from GuardedCollection{T}: bool Contains(T item)
int ContainsCount(T item) Inherited from GuardedCollection{T}: int ContainsCount(T item)
bool ContainsAll(System.Collections.Generic.IEnumerable<T> items) Inherited from GuardedCollection{T}: bool ContainsAll(System.Collections.Generic.IEnumerable<T> items)
bool Find(ref T item) Inherited from GuardedCollection{T}: bool Find(ref T item)
bool FindOrAdd(ref T item) Inherited from GuardedCollection{T}: bool FindOrAdd(ref T item)
bool Update(T item) Inherited from GuardedCollection{T}: bool Update(T item)
bool UpdateOrAdd(T item) Inherited from GuardedCollection{T}: bool UpdateOrAdd(T item)
bool Remove(T item) Inherited from GuardedCollection{T}: bool Remove(T item)
bool RemoveWithReturn(ref T item) Inherited from GuardedCollection{T}: bool RemoveWithReturn(ref T item)
void RemoveAllCopies(T item) Inherited from GuardedCollection{T}: void RemoveAllCopies(T item)
void RemoveAll(System.Collections.Generic.IEnumerable<T> items) Inherited from GuardedCollection{T}: void RemoveAll(System.Collections.Generic.IEnumerable<T> items)
void Clear() Inherited from GuardedCollection{T}: void Clear()
void RetainAll(System.Collections.Generic.IEnumerable<T> items) Inherited from GuardedCollection{T}: void RetainAll(System.Collections.Generic.IEnumerable<T> items)
bool Check() Inherited from GuardedCollection{T}: bool Check()
bool Add(T item) Inherited from GuardedCollection{T}: bool Add(T item)
void AddAll(System.Collections.Generic.IEnumerable<T> items) Inherited from GuardedCollection{T}: void AddAll(System.Collections.Generic.IEnumerable<T> items)
void CopyTo(T[] a, int i) Inherited from GuardedCollectionValue{T}: void CopyTo(T[] a, int i)
T[] ToArray() Inherited from GuardedCollectionValue{T}: T[] ToArray()
void Apply(Applier<T> a) Inherited from GuardedCollectionValue{T}: void Apply(Applier<T> a)
bool Exists(Filter<T> filter) Inherited from GuardedCollectionValue{T}: bool Exists(Filter<T> filter)
bool All(Filter<T> filter) Inherited from GuardedCollectionValue{T}: bool All(Filter<T> filter)
System.Collections.Generic.IEnumerator<T> GetEnumerator() Inherited from GuardedEnumerable{T}: System.Collections.Generic.IEnumerator<T> GetEnumerator()
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class GuardedSorted<T>

A read-only wrapper for a sorted collection

This is mainly interesting as a base of other guard classes

Implements

System.Collections.Generic.IEnumerable<T>, ICollection<T>, ICollectionValue<T>, IDirectedCollectionValue<T>, IDirectedEnumerable<T>, IExtensible<T>, IPriorityQueue<T>, ISequenced<T>, ISorted<T>

Bases

object, GuardedEnumerable<T>, GuardedCollectionValue<T>, GuardedCollection<T>, GuardedSequenced<T>

Base of

GuardedIndexedSorted<T>

Property overview

bool AllowsDuplicates, IComparer<T> Comparer, Speed ContainsSpeed, int Count, Speed CountSpeed, EnumerationDirection Direction, bool IsEmpty, bool IsReadOnly, object SyncRoot

Constructor overview

GuardedSorted<T>(ISorted<T> sorted)

Method overview

bool Add(T item), void AddAll(System.Collections.Generic.IEnumerable<T> items), void AddSorted(System.Collections.Generic.IEnumerable<T> items), bool All(Filter<T> filter), void Apply(Applier<T> a), IDirectedCollectionValue<T> Backwards(), bool Check(), void Clear(), bool Contains(T item), bool ContainsAll(System.Collections.Generic.IEnumerable<T> items), int ContainsCount(T item), void CopyTo(T[] a, int i), bool Cut(System.IComparable<T> c, out T low, out bool lval, out T high, out bool hval), T DeleteMax(), T DeleteMin(), bool Equals(object obj), bool Exists(Filter<T> filter), void Finalize(), bool Find(ref T item), T FindMax(), T FindMin(), bool FindOrAdd(ref T item), System.Collections.Generic.IEnumerator<T> GetEnumerator(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), T Predecessor(T item), IDirectedCollectionValue<T> RangeAll(), IDirectedEnumerable<T> RangeFrom(T bot), IDirectedEnumerable<T> RangeFromTo(T bot, T top), IDirectedEnumerable<T> RangeTo(T top), bool Remove(T item), void RemoveAll(System.Collections.Generic.IEnumerable<T> items), void RemoveAllCopies(T item), void RemoveRangeFrom(T low), void RemoveRangeFromTo(T low, T hi), void RemoveRangeTo(T hi), bool RemoveWithReturn(ref T item), void RetainAll(System.Collections.Generic.IEnumerable<T> items), T Successor(T item), T[] ToArray(), string ToString(), bool Update(T item), bool UpdateOrAdd(T item), T WeakPredecessor(T item), T WeakSuccessor(T item)

Property details

IComparer<T> Comparer Value: The comparerThe comparer object supplied at creation time for the underlying collection
EnumerationDirection Direction Inherited from GuardedSequenced{T}: EnumerationDirection Direction
bool IsReadOnly Inherited from GuardedCollection{T}: bool IsReadOnly
Speed ContainsSpeed Inherited from GuardedCollection{T}: Speed ContainsSpeed
bool AllowsDuplicates Inherited from GuardedCollection{T}: bool AllowsDuplicates
object SyncRoot Inherited from GuardedCollection{T}: object SyncRoot
bool IsEmpty Inherited from GuardedCollection{T}: bool IsEmpty
int Count Inherited from GuardedCollectionValue{T}: int Count
Speed CountSpeed Inherited from GuardedCollectionValue{T}: Speed CountSpeed

Constructor details

GuardedSorted<T>(ISorted<T> sorted) Wrap a sorted collection in a read-only wrapper
sorted:

Method details

T Predecessor(T item) Find the predecessor of the item in the wrapped sorted collection
Returns: The predecessor
item: The item
T Successor(T item) Find the Successor of the item in the wrapped sorted collection
Returns: The Successor
item: The item
T WeakPredecessor(T item) Find the weak predecessor of the item in the wrapped sorted collection
Returns: The weak predecessor
item: The item
T WeakSuccessor(T item) Find the weak Successor of the item in the wrapped sorted collection
Returns: The weak Successor
item: The item
bool Cut(System.IComparable<T> c, out T low, out bool lval, out T high, out bool hval) Run Cut on the wrapped sorted collection
Returns:
c:
low:
lval:
high:
hval:
IDirectedEnumerable<T> RangeFrom(T bot) Get the specified range from the wrapped collection. (The current implementation erroneously does not wrap the result.)
Returns:
bot:
IDirectedEnumerable<T> RangeFromTo(T bot, T top) Get the specified range from the wrapped collection. (The current implementation erroneously does not wrap the result.)
Returns:
bot:
top:
IDirectedEnumerable<T> RangeTo(T top) Get the specified range from the wrapped collection. (The current implementation erroneously does not wrap the result.)
Returns:
top:
IDirectedCollectionValue<T> RangeAll() Get the specified range from the wrapped collection. (The current implementation erroneously does not wrap the result.)
Returns:
void AddSorted(System.Collections.Generic.IEnumerable<T> items)
Throws System.InvalidOperationException since this is a read-only wrappper
items:
void RemoveRangeFrom(T low)
Throws System.InvalidOperationException since this is a read-only wrappper
low:
void RemoveRangeFromTo(T low, T hi)
Throws System.InvalidOperationException since this is a read-only wrappper
low:
hi:
void RemoveRangeTo(T hi)
Throws System.InvalidOperationException since this is a read-only wrappper
hi:
T FindMin() Find the minimum of the wrapped collection
Returns: The minimum
T DeleteMin()
Throws System.InvalidOperationException since this is a read-only wrappper
Returns:
T FindMax() Find the maximum of the wrapped collection
Returns: The maximum
T DeleteMax()
Throws System.InvalidOperationException since this is a read-only wrappper
Returns:
IDirectedCollectionValue<T> Backwards() Inherited from GuardedSequenced{T}: IDirectedCollectionValue<T> Backwards()
bool Contains(T item) Inherited from GuardedCollection{T}: bool Contains(T item)
int ContainsCount(T item) Inherited from GuardedCollection{T}: int ContainsCount(T item)
bool ContainsAll(System.Collections.Generic.IEnumerable<T> items) Inherited from GuardedCollection{T}: bool ContainsAll(System.Collections.Generic.IEnumerable<T> items)
bool Find(ref T item) Inherited from GuardedCollection{T}: bool Find(ref T item)
bool FindOrAdd(ref T item) Inherited from GuardedCollection{T}: bool FindOrAdd(ref T item)
bool Update(T item) Inherited from GuardedCollection{T}: bool Update(T item)
bool UpdateOrAdd(T item) Inherited from GuardedCollection{T}: bool UpdateOrAdd(T item)
bool Remove(T item) Inherited from GuardedCollection{T}: bool Remove(T item)
bool RemoveWithReturn(ref T item) Inherited from GuardedCollection{T}: bool RemoveWithReturn(ref T item)
void RemoveAllCopies(T item) Inherited from GuardedCollection{T}: void RemoveAllCopies(T item)
void RemoveAll(System.Collections.Generic.IEnumerable<T> items) Inherited from GuardedCollection{T}: void RemoveAll(System.Collections.Generic.IEnumerable<T> items)
void Clear() Inherited from GuardedCollection{T}: void Clear()
void RetainAll(System.Collections.Generic.IEnumerable<T> items) Inherited from GuardedCollection{T}: void RetainAll(System.Collections.Generic.IEnumerable<T> items)
bool Check() Inherited from GuardedCollection{T}: bool Check()
bool Add(T item) Inherited from GuardedCollection{T}: bool Add(T item)
void AddAll(System.Collections.Generic.IEnumerable<T> items) Inherited from GuardedCollection{T}: void AddAll(System.Collections.Generic.IEnumerable<T> items)
void CopyTo(T[] a, int i) Inherited from GuardedCollectionValue{T}: void CopyTo(T[] a, int i)
T[] ToArray() Inherited from GuardedCollectionValue{T}: T[] ToArray()
void Apply(Applier<T> a) Inherited from GuardedCollectionValue{T}: void Apply(Applier<T> a)
bool Exists(Filter<T> filter) Inherited from GuardedCollectionValue{T}: bool Exists(Filter<T> filter)
bool All(Filter<T> filter) Inherited from GuardedCollectionValue{T}: bool All(Filter<T> filter)
System.Collections.Generic.IEnumerator<T> GetEnumerator() Inherited from GuardedEnumerable{T}: System.Collections.Generic.IEnumerator<T> GetEnumerator()
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class GuardedIndexedSorted<T>

Read-only wrapper for indexed sorted collections

Suitable for wrapping TreeSet, TreeBag and SortedArray

Implements

System.Collections.Generic.IEnumerable<T>, ICollection<T>, ICollectionValue<T>, IDirectedCollectionValue<T>, IDirectedEnumerable<T>, IExtensible<T>, IIndexed<T>, IIndexedSorted<T>, IPriorityQueue<T>, ISequenced<T>, ISorted<T>

Bases

object, GuardedEnumerable<T>, GuardedCollectionValue<T>, GuardedCollection<T>, GuardedSequenced<T>, GuardedSorted<T>

Property overview

bool AllowsDuplicates, IComparer<T> Comparer, Speed ContainsSpeed, int Count, Speed CountSpeed, EnumerationDirection Direction, bool IsEmpty, bool IsReadOnly, T this[int i], IDirectedCollectionValue<T> this[int start, int end], object SyncRoot

Constructor overview

GuardedIndexedSorted<T>(IIndexedSorted<T> list)

Method overview

bool Add(T item), void AddAll(System.Collections.Generic.IEnumerable<T> items), void AddSorted(System.Collections.Generic.IEnumerable<T> items), bool All(Filter<T> filter), void Apply(Applier<T> a), IDirectedCollectionValue<T> Backwards(), bool Check(), void Clear(), bool Contains(T item), bool ContainsAll(System.Collections.Generic.IEnumerable<T> items), int ContainsCount(T item), void CopyTo(T[] a, int i), int CountFrom(T bot), int CountFromTo(T bot, T top), int CountTo(T top), bool Cut(System.IComparable<T> c, out T low, out bool lval, out T high, out bool hval), T DeleteMax(), T DeleteMin(), bool Equals(object obj), bool Exists(Filter<T> filter), void Finalize(), bool Find(ref T item), IIndexedSorted<T> FindAll(Filter<T> f), T FindMax(), T FindMin(), bool FindOrAdd(ref T item), System.Collections.Generic.IEnumerator<T> GetEnumerator(), int GetHashCode(), System.Type GetType(), int IndexOf(T item), int LastIndexOf(T item), IIndexedSorted<V> Map<V>(Mapper<T,V> m, IComparer<V> c), object MemberwiseClone(), T Predecessor(T item), IDirectedCollectionValue<T> RangeAll(), IDirectedCollectionValue<T> RangeFrom(T bot), IDirectedEnumerable<T> RangeFrom(T bot), IDirectedCollectionValue<T> RangeFromTo(T bot, T top), IDirectedEnumerable<T> RangeFromTo(T bot, T top), IDirectedCollectionValue<T> RangeTo(T top), IDirectedEnumerable<T> RangeTo(T top), bool Remove(T item), void RemoveAll(System.Collections.Generic.IEnumerable<T> items), void RemoveAllCopies(T item), T RemoveAt(int i), void RemoveInterval(int start, int count), void RemoveRangeFrom(T low), void RemoveRangeFromTo(T low, T hi), void RemoveRangeTo(T hi), bool RemoveWithReturn(ref T item), void RetainAll(System.Collections.Generic.IEnumerable<T> items), T Successor(T item), T[] ToArray(), string ToString(), bool Update(T item), bool UpdateOrAdd(T item), T WeakPredecessor(T item), T WeakSuccessor(T item)

Property details

T this[int i] Value: The i'th item of the wrapped sorted collection
i:
IDirectedCollectionValue<T> this[int start, int end] Value: A directed collection of the items in the indicated interval of the wrapped collection
start:
end:
IComparer<T> Comparer Inherited from GuardedSorted{T}: IComparer<T> Comparer
EnumerationDirection Direction Inherited from GuardedSequenced{T}: EnumerationDirection Direction
bool IsReadOnly Inherited from GuardedCollection{T}: bool IsReadOnly
Speed ContainsSpeed Inherited from GuardedCollection{T}: Speed ContainsSpeed
bool AllowsDuplicates Inherited from GuardedCollection{T}: bool AllowsDuplicates
object SyncRoot Inherited from GuardedCollection{T}: object SyncRoot
bool IsEmpty Inherited from GuardedCollection{T}: bool IsEmpty
int Count Inherited from GuardedCollectionValue{T}: int Count
Speed CountSpeed Inherited from GuardedCollectionValue{T}: Speed CountSpeed

Constructor details

GuardedIndexedSorted<T>(IIndexedSorted<T> list) Wrap an indexed sorted collection in a read-only wrapper
list: the indexed sorted collection

Method details

IIndexedSorted<V> Map<V>(Mapper<T,V> m, IComparer<V> c) Run Map on the wrapped collection with the indicated mapper. The result will not be read-only.
Returns:
m:
c: The comparer to use in the result
IDirectedCollectionValue<T> RangeFrom(T bot) Get the specified range from the wrapped collection. (The current implementation erroneously does not wrap the result.)
Returns:
bot:
IDirectedCollectionValue<T> RangeFromTo(T bot, T top) Get the specified range from the wrapped collection. (The current implementation erroneously does not wrap the result.)
Returns:
bot:
top:
IDirectedCollectionValue<T> RangeTo(T top) Get the specified range from the wrapped collection. (The current implementation erroneously does not wrap the result.)
Returns:
top:
int CountFrom(T bot) Report the number of items in the specified range of the wrapped collection
Returns:
bot:
int CountFromTo(T bot, T top) Report the number of items in the specified range of the wrapped collection
Returns:
bot:
top:
int CountTo(T top) Report the number of items in the specified range of the wrapped collection
Returns:
top:
IIndexedSorted<T> FindAll(Filter<T> f) Run FindAll on the wrapped collection with the indicated filter. The result will not be read-only.
Returns:
f:
int IndexOf(T item) Find the (first) index of an item in the wrapped collection
Returns:
item:
int LastIndexOf(T item) Find the last index of an item in the wrapped collection
Returns:
item:
T RemoveAt(int i)
Throws System.InvalidOperationException since this is a read-only wrappper
Returns:
i:
void RemoveInterval(int start, int count)
Throws System.InvalidOperationException since this is a read-only wrappper
start:
count:
T Predecessor(T item) Inherited from GuardedSorted{T}: T Predecessor(T item)
T Successor(T item) Inherited from GuardedSorted{T}: T Successor(T item)
T WeakPredecessor(T item) Inherited from GuardedSorted{T}: T WeakPredecessor(T item)
T WeakSuccessor(T item) Inherited from GuardedSorted{T}: T WeakSuccessor(T item)
bool Cut(System.IComparable<T> c, out T low, out bool lval, out T high, out bool hval) Inherited from GuardedSorted{T}: bool Cut(System.IComparable<T> c, out T low, out bool lval, out T high, out bool hval)
IDirectedEnumerable<T> RangeFrom(T bot) Inherited from GuardedSorted{T}: IDirectedEnumerable<T> RangeFrom(T bot)
IDirectedEnumerable<T> RangeFromTo(T bot, T top) Inherited from GuardedSorted{T}: IDirectedEnumerable<T> RangeFromTo(T bot, T top)
IDirectedEnumerable<T> RangeTo(T top) Inherited from GuardedSorted{T}: IDirectedEnumerable<T> RangeTo(T top)
IDirectedCollectionValue<T> RangeAll() Inherited from GuardedSorted{T}: IDirectedCollectionValue<T> RangeAll()
void AddSorted(System.Collections.Generic.IEnumerable<T> items) Inherited from GuardedSorted{T}: void AddSorted(System.Collections.Generic.IEnumerable<T> items)
void RemoveRangeFrom(T low) Inherited from GuardedSorted{T}: void RemoveRangeFrom(T low)
void RemoveRangeFromTo(T low, T hi) Inherited from GuardedSorted{T}: void RemoveRangeFromTo(T low, T hi)
void RemoveRangeTo(T hi) Inherited from GuardedSorted{T}: void RemoveRangeTo(T hi)
T FindMin() Inherited from GuardedSorted{T}: T FindMin()
T DeleteMin() Inherited from GuardedSorted{T}: T DeleteMin()
T FindMax() Inherited from GuardedSorted{T}: T FindMax()
T DeleteMax() Inherited from GuardedSorted{T}: T DeleteMax()
IDirectedCollectionValue<T> Backwards() Inherited from GuardedSequenced{T}: IDirectedCollectionValue<T> Backwards()
bool Contains(T item) Inherited from GuardedCollection{T}: bool Contains(T item)
int ContainsCount(T item) Inherited from GuardedCollection{T}: int ContainsCount(T item)
bool ContainsAll(System.Collections.Generic.IEnumerable<T> items) Inherited from GuardedCollection{T}: bool ContainsAll(System.Collections.Generic.IEnumerable<T> items)
bool Find(ref T item) Inherited from GuardedCollection{T}: bool Find(ref T item)
bool FindOrAdd(ref T item) Inherited from GuardedCollection{T}: bool FindOrAdd(ref T item)
bool Update(T item) Inherited from GuardedCollection{T}: bool Update(T item)
bool UpdateOrAdd(T item) Inherited from GuardedCollection{T}: bool UpdateOrAdd(T item)
bool Remove(T item) Inherited from GuardedCollection{T}: bool Remove(T item)
bool RemoveWithReturn(ref T item) Inherited from GuardedCollection{T}: bool RemoveWithReturn(ref T item)
void RemoveAllCopies(T item) Inherited from GuardedCollection{T}: void RemoveAllCopies(T item)
void RemoveAll(System.Collections.Generic.IEnumerable<T> items) Inherited from GuardedCollection{T}: void RemoveAll(System.Collections.Generic.IEnumerable<T> items)
void Clear() Inherited from GuardedCollection{T}: void Clear()
void RetainAll(System.Collections.Generic.IEnumerable<T> items) Inherited from GuardedCollection{T}: void RetainAll(System.Collections.Generic.IEnumerable<T> items)
bool Check() Inherited from GuardedCollection{T}: bool Check()
bool Add(T item) Inherited from GuardedCollection{T}: bool Add(T item)
void AddAll(System.Collections.Generic.IEnumerable<T> items) Inherited from GuardedCollection{T}: void AddAll(System.Collections.Generic.IEnumerable<T> items)
void CopyTo(T[] a, int i) Inherited from GuardedCollectionValue{T}: void CopyTo(T[] a, int i)
T[] ToArray() Inherited from GuardedCollectionValue{T}: T[] ToArray()
void Apply(Applier<T> a) Inherited from GuardedCollectionValue{T}: void Apply(Applier<T> a)
bool Exists(Filter<T> filter) Inherited from GuardedCollectionValue{T}: bool Exists(Filter<T> filter)
bool All(Filter<T> filter) Inherited from GuardedCollectionValue{T}: bool All(Filter<T> filter)
System.Collections.Generic.IEnumerator<T> GetEnumerator() Inherited from GuardedEnumerable{T}: System.Collections.Generic.IEnumerator<T> GetEnumerator()
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class GuardedList<T>

A read-only wrapper for a generic list collection

Suitable as a wrapper for LinkedList, HashedLinkedList, ArrayList and HashedArray. See , See , See or See .

Implements

System.Collections.Generic.IEnumerable<T>, ICollection<T>, ICollectionValue<T>, IDirectedCollectionValue<T>, IDirectedEnumerable<T>, IExtensible<T>, IIndexed<T>, IList<T>, IQueue<T>, ISequenced<T>, IStack<T>

Bases

object, GuardedEnumerable<T>, GuardedCollectionValue<T>, GuardedCollection<T>, GuardedSequenced<T>

Property overview

bool AllowsDuplicates, Speed ContainsSpeed, int Count, Speed CountSpeed, EnumerationDirection Direction, bool FIFO, T First, bool IsEmpty, bool IsReadOnly, T this[int i], IDirectedCollectionValue<T> this[int start, int end], T Last, int Offset, object SyncRoot, IList<T> Underlying

Constructor overview

GuardedList<T>(IList<T> list)

Method overview

bool Add(T item), void AddAll(System.Collections.Generic.IEnumerable<T> items), bool All(Filter<T> filter), void Apply(Applier<T> a), IDirectedCollectionValue<T> Backwards(), bool Check(), void Clear(), bool Contains(T item), bool ContainsAll(System.Collections.Generic.IEnumerable<T> items), int ContainsCount(T item), void CopyTo(T[] a, int i), T DeQueue(), void EnQueue(T item), bool Equals(object obj), bool Exists(Filter<T> filter), void Finalize(), bool Find(ref T item), IList<T> FindAll(Filter<T> filter), bool FindOrAdd(ref T item), System.Collections.Generic.IEnumerator<T> GetEnumerator(), int GetHashCode(), System.Type GetType(), int IndexOf(T item), void Insert(int i, T item), void InsertAfter(T item, T target), void InsertAll(int i, System.Collections.Generic.IEnumerable<T> items), void InsertBefore(T item, T target), void InsertFirst(T item), void InsertLast(T item), bool IsSorted(IComparer<T> c), int LastIndexOf(T item), IList<V> Map<V>(Mapper<T,V> mapper), IList<V> Map<V>(Mapper<T,V> mapper, IHasher<V> hasher), object MemberwiseClone(), T Pop(), void Push(T item), T Remove(), bool Remove(T item), void RemoveAll(System.Collections.Generic.IEnumerable<T> items), void RemoveAllCopies(T item), T RemoveAt(int i), T RemoveFirst(), void RemoveInterval(int start, int count), T RemoveLast(), bool RemoveWithReturn(ref T item), void RetainAll(System.Collections.Generic.IEnumerable<T> items), void Reverse(), void Reverse(int start, int count), void Shuffle(), void Shuffle(System.Random rnd), void Slide(int offset), void Slide(int offset, int size), void Sort(IComparer<T> c), T[] ToArray(), string ToString(), bool Update(T item), bool UpdateOrAdd(T item), IList<T> View(int start, int count)

Property details

T First Value: The first item of the wrapped list
T Last Value: The last item of the wrapped list
bool FIFO Value: True if wrapped list has FIFO semantics for the Add(T item) and Remove() methods
Throws System.InvalidOperationException if used as setter
T this[int i] Value: The i'th item of the wrapped list
Throws System.InvalidOperationException if used as setter
i:
IList<T> Underlying Value: The wrapped underlying list of the wrapped view(This is wrong functionality)
int Offset Value: The offset of the wrapped list as a view.
IDirectedCollectionValue<T> this[int start, int end] Value: A directed collection of the items in the indicated interval of the wrapped collection
start:
end:
EnumerationDirection Direction Inherited from GuardedSequenced{T}: EnumerationDirection Direction
bool IsReadOnly Inherited from GuardedCollection{T}: bool IsReadOnly
Speed ContainsSpeed Inherited from GuardedCollection{T}: Speed ContainsSpeed
bool AllowsDuplicates Inherited from GuardedCollection{T}: bool AllowsDuplicates
object SyncRoot Inherited from GuardedCollection{T}: object SyncRoot
bool IsEmpty Inherited from GuardedCollection{T}: bool IsEmpty
int Count Inherited from GuardedCollectionValue{T}: int Count
Speed CountSpeed Inherited from GuardedCollectionValue{T}: Speed CountSpeed

Constructor details

GuardedList<T>(IList<T> list) Wrap a list in a read-only wrapper
list: The list

Method details

IList<V> Map<V>(Mapper<T,V> mapper) Perform Map on the wrapped list. The result is not necessarily read-only.
Returns: The mapped list
mapper: The mapper to use.
IList<V> Map<V>(Mapper<T,V> mapper, IHasher<V> hasher) Perform Map on the wrapped list. The result is not necessarily read-only.
Returns: The new list.
mapper: The delegate defining the map.
hasher: The hasher to use for the new list
void Insert(int i, T item)
Throws System.InvalidOperationException since this is a read-only wrappper
i:
item:
void InsertFirst(T item)
Throws System.InvalidOperationException since this is a read-only wrappper
item:
void InsertLast(T item)
Throws System.InvalidOperationException since this is a read-only wrappper
item:
void InsertBefore(T item, T target)
Throws System.InvalidOperationException since this is a read-only wrappper
item:
target:
void InsertAfter(T item, T target)
Throws System.InvalidOperationException since this is a read-only wrappper
item:
target:
void InsertAll(int i, System.Collections.Generic.IEnumerable<T> items)
Throws System.InvalidOperationException since this is a read-only wrappper
i:
items:
IList<T> FindAll(Filter<T> filter) Perform FindAll on the wrapped list. The result is not necessarily read-only.
Returns:
filter: The filter to use
T Remove()
Throws System.InvalidOperationException since this is a read-only wrappper
Returns:
T RemoveFirst()
Throws System.InvalidOperationException since this is a read-only wrappper
Returns:
T RemoveLast()
Throws System.InvalidOperationException since this is a read-only wrappper
Returns:
IList<T> View(int start, int count) Create the indicated view on the wrapped list and wrap it read-only.
Returns:
start:
count:
void Slide(int offset)
Throws System.InvalidOperationException since this is a read-only wrappper
offset:
void Slide(int offset, int size)
Throws System.InvalidOperationException since this is a read-only wrappper
offset:
size:
void Reverse()
Throws System.InvalidOperationException since this is a read-only wrappper
void Reverse(int start, int count)
Throws System.InvalidOperationException since this is a read-only wrappper
start:
count:
bool IsSorted(IComparer<T> c) Check if wrapped list is sorted
Returns: True if sorted
c: The sorting order to use
void Sort(IComparer<T> c)
Throws System.InvalidOperationException since this is a read-only wrappper
c:
void Shuffle()
Throws System.InvalidOperationException since this is a read-only wrappper
void Shuffle(System.Random rnd)
Throws System.InvalidOperationException since this is a read-only wrappper
rnd:
int IndexOf(T item) Find the (first) index of an item in the wrapped collection
Returns:
item:
int LastIndexOf(T item) Find the last index of an item in the wrapped collection
Returns:
item:
T RemoveAt(int i)
Throws System.InvalidOperationException since this is a read-only wrappper
Returns:
i:
void RemoveInterval(int start, int count)
Throws System.InvalidOperationException since this is a read-only wrappper
start:
count:
void Push(T item)
item:
T Pop()
Returns: -
void EnQueue(T item)
item:
T DeQueue()
Returns: -
IDirectedCollectionValue<T> Backwards() Inherited from GuardedSequenced{T}: IDirectedCollectionValue<T> Backwards()
bool Contains(T item) Inherited from GuardedCollection{T}: bool Contains(T item)
int ContainsCount(T item) Inherited from GuardedCollection{T}: int ContainsCount(T item)
bool ContainsAll(System.Collections.Generic.IEnumerable<T> items) Inherited from GuardedCollection{T}: bool ContainsAll(System.Collections.Generic.IEnumerable<T> items)
bool Find(ref T item) Inherited from GuardedCollection{T}: bool Find(ref T item)
bool FindOrAdd(ref T item) Inherited from GuardedCollection{T}: bool FindOrAdd(ref T item)
bool Update(T item) Inherited from GuardedCollection{T}: bool Update(T item)
bool UpdateOrAdd(T item) Inherited from GuardedCollection{T}: bool UpdateOrAdd(T item)
bool Remove(T item) Inherited from GuardedCollection{T}: bool Remove(T item)
bool RemoveWithReturn(ref T item) Inherited from GuardedCollection{T}: bool RemoveWithReturn(ref T item)
void RemoveAllCopies(T item) Inherited from GuardedCollection{T}: void RemoveAllCopies(T item)
void RemoveAll(System.Collections.Generic.IEnumerable<T> items) Inherited from GuardedCollection{T}: void RemoveAll(System.Collections.Generic.IEnumerable<T> items)
void Clear() Inherited from GuardedCollection{T}: void Clear()
void RetainAll(System.Collections.Generic.IEnumerable<T> items) Inherited from GuardedCollection{T}: void RetainAll(System.Collections.Generic.IEnumerable<T> items)
bool Check() Inherited from GuardedCollection{T}: bool Check()
bool Add(T item) Inherited from GuardedCollection{T}: bool Add(T item)
void AddAll(System.Collections.Generic.IEnumerable<T> items) Inherited from GuardedCollection{T}: void AddAll(System.Collections.Generic.IEnumerable<T> items)
void CopyTo(T[] a, int i) Inherited from GuardedCollectionValue{T}: void CopyTo(T[] a, int i)
T[] ToArray() Inherited from GuardedCollectionValue{T}: T[] ToArray()
void Apply(Applier<T> a) Inherited from GuardedCollectionValue{T}: void Apply(Applier<T> a)
bool Exists(Filter<T> filter) Inherited from GuardedCollectionValue{T}: bool Exists(Filter<T> filter)
bool All(Filter<T> filter) Inherited from GuardedCollectionValue{T}: bool All(Filter<T> filter)
System.Collections.Generic.IEnumerator<T> GetEnumerator() Inherited from GuardedEnumerable{T}: System.Collections.Generic.IEnumerator<T> GetEnumerator()
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class GuardedDictionary<K,V>

A read-only wrapper for a dictionary.

Suitable for wrapping a HashDictionary. See

Implements

System.Collections.Generic.IEnumerable<KeyValuePair<K,V>>, IDictionary<K,V>

Bases

object, GuardedEnumerable<KeyValuePair<K,V>>

Base of

GuardedSortedDictionary<K,V>

Property overview

int Count, bool IsReadOnly, V this[K key], ICollectionValue<K> Keys, object SyncRoot, ICollectionValue<V> Values

Constructor overview

GuardedDictionary<K,V>(IDictionary<K,V> dict)

Method overview

void Add(K key, V val), bool Check(), void Clear(), bool Contains(K key), bool Equals(object obj), void Finalize(), bool Find(K key, out V val), bool FindOrAdd(K key, ref V val), System.Collections.Generic.IEnumerator<KeyValuePair<K,V>> GetEnumerator(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), bool Remove(K key), bool Remove(K key, out V val), string ToString(), bool Update(K key, V val), bool UpdateOrAdd(K key, V val)

Property details

V this[K key] Value: Get the value corresponding to a key in the wrapped dictionary
Throws System.InvalidOperationException since this is a read-only wrappper if used as a setter
key:
int Count Value: The size of the wrapped dictionary
bool IsReadOnly Value: True(This is a read-only wrapper)
object SyncRoot Value: The sync root of the wrapped dictionary
ICollectionValue<K> Keys Value: The collection of keys of the wrapped dictionary
ICollectionValue<V> Values Value: The collection of values of the wrapped dictionary

Constructor details

GuardedDictionary<K,V>(IDictionary<K,V> dict) Wrap a dictionary in a read-only wrapper
dict: the dictionary

Method details

void Add(K key, V val)
Throws System.InvalidOperationException since this is a read-only wrappper
key:
val:
bool Remove(K key)
Throws System.InvalidOperationException since this is a read-only wrappper
Returns:
key:
bool Remove(K key, out V val)
Throws System.InvalidOperationException since this is a read-only wrappper
Returns:
key:
val:
void Clear()
Throws System.InvalidOperationException since this is a read-only wrappper
bool Contains(K key) Check if the wrapped dictionary contains a specific key
Returns: True if it does
key: The key
bool Find(K key, out V val) Search for a key in the wrapped dictionary, reporting the value if found
Returns: True if found
key: The key
val: On exit: the value if found
bool Update(K key, V val)
Throws System.InvalidOperationException since this is a read-only wrappper
Returns:
key:
val:
bool FindOrAdd(K key, ref V val)
Throws System.InvalidOperationException since this is a read-only wrappper
Returns:
key:
val:
bool UpdateOrAdd(K key, V val)
Throws System.InvalidOperationException since this is a read-only wrappper
Returns:
key:
val:
bool Check() Check the internal consistency of the wrapped dictionary
Returns: True if check passed
System.Collections.Generic.IEnumerator<KeyValuePair<K,V>> GetEnumerator() Inherited from GuardedEnumerable{KeyValuePair{K,V}}: System.Collections.Generic.IEnumerator<KeyValuePair<K,V>> GetEnumerator()
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class GuardedSortedDictionary<K,V>

A read-only wrapper for a sorted dictionary.

Suitable for wrapping a Dictionary. See

Implements

System.Collections.Generic.IEnumerable<KeyValuePair<K,V>>, IDictionary<K,V>, ISortedDictionary<K,V>

Bases

object, GuardedEnumerable<KeyValuePair<K,V>>, GuardedDictionary<K,V>

Property overview

int Count, bool IsReadOnly, V this[K key], ICollectionValue<K> Keys, object SyncRoot, ICollectionValue<V> Values

Constructor overview

GuardedSortedDictionary<K,V>(ISortedDictionary<K,V> sorteddict)

Method overview

void Add(K key, V val), bool Check(), void Clear(), bool Contains(K key), bool Equals(object obj), void Finalize(), bool Find(K key, out V val), bool FindOrAdd(K key, ref V val), System.Collections.Generic.IEnumerator<KeyValuePair<K,V>> GetEnumerator(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), KeyValuePair<K,V> Predecessor(K key), bool Remove(K key), bool Remove(K key, out V val), KeyValuePair<K,V> Successor(K key), string ToString(), bool Update(K key, V val), bool UpdateOrAdd(K key, V val), KeyValuePair<K,V> WeakPredecessor(K key), KeyValuePair<K,V> WeakSuccessor(K key)

Property details

V this[K key] Inherited from GuardedDictionary{K,V}: V this[K key]
int Count Inherited from GuardedDictionary{K,V}: int Count
bool IsReadOnly Inherited from GuardedDictionary{K,V}: bool IsReadOnly
object SyncRoot Inherited from GuardedDictionary{K,V}: object SyncRoot
ICollectionValue<K> Keys Inherited from GuardedDictionary{K,V}: ICollectionValue<K> Keys
ICollectionValue<V> Values Inherited from GuardedDictionary{K,V}: ICollectionValue<V> Values

Constructor details

GuardedSortedDictionary<K,V>(ISortedDictionary<K,V> sorteddict) Wrap a sorted dictionary in a read-only wrapper
sorteddict: the dictionary

Method details

KeyValuePair<K,V> Predecessor(K key) Get the entry in the wrapped dictionary whose key is the predecessor of a specified key.
Returns: The entry
key: The key
KeyValuePair<K,V> Successor(K key) Get the entry in the wrapped dictionary whose key is the successor of a specified key.
Returns: The entry
key: The key
KeyValuePair<K,V> WeakPredecessor(K key) Get the entry in the wrapped dictionary whose key is the weak predecessor of a specified key.
Returns: The entry
key: The key
KeyValuePair<K,V> WeakSuccessor(K key) Get the entry in the wrapped dictionary whose key is the weak successor of a specified key.
Returns: The entry
key: The key
void Add(K key, V val) Inherited from GuardedDictionary{K,V}: void Add(K key, V val)
bool Remove(K key) Inherited from GuardedDictionary{K,V}: bool Remove(K key)
bool Remove(K key, out V val) Inherited from GuardedDictionary{K,V}: bool Remove(K key, out V val)
void Clear() Inherited from GuardedDictionary{K,V}: void Clear()
bool Contains(K key) Inherited from GuardedDictionary{K,V}: bool Contains(K key)
bool Find(K key, out V val) Inherited from GuardedDictionary{K,V}: bool Find(K key, out V val)
bool Update(K key, V val) Inherited from GuardedDictionary{K,V}: bool Update(K key, V val)
bool FindOrAdd(K key, ref V val) Inherited from GuardedDictionary{K,V}: bool FindOrAdd(K key, ref V val)
bool UpdateOrAdd(K key, V val) Inherited from GuardedDictionary{K,V}: bool UpdateOrAdd(K key, V val)
bool Check() Inherited from GuardedDictionary{K,V}: bool Check()
System.Collections.Generic.IEnumerator<KeyValuePair<K,V>> GetEnumerator() Inherited from GuardedEnumerable{KeyValuePair{K,V}}: System.Collections.Generic.IEnumerator<KeyValuePair<K,V>> GetEnumerator()
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class IntervalHeap<T>

A priority queue class based on an interval heap data structure.

Implements

System.Collections.Generic.IEnumerable<T>, ICollectionValue<T>, IExtensible<T>, IPriorityQueue<T>

Bases

object, EnumerableBase<T>, CollectionValueBase<T>

Property overview

bool AllowsDuplicates, IComparer<T> Comparer, int Count, Speed CountSpeed, bool IsEmpty, object SyncRoot

Constructor overview

IntervalHeap<T>(), IntervalHeap<T>(IComparer<T> c), IntervalHeap<T>(int capacity), IntervalHeap<T>(IComparer<T> c, int capacity)

Method overview

bool Add(T item), void AddAll<U>(System.Collections.Generic.IEnumerable<U> items), void AddAll(System.Collections.Generic.IEnumerable<T> items), bool All(Filter<T> filter), void Apply(Applier<T> a), bool Check(), void CopyTo(T[] a, int i), T DeleteMax(), T DeleteMin(), bool Equals(object obj), bool Exists(Filter<T> filter), void Finalize(), T FindMax(), T FindMin(), System.Collections.Generic.IEnumerator<T> GetEnumerator(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), T[] ToArray(), string ToString()

Property details

IComparer<T> Comparer Value: The comparerThe comparer object supplied at creation time for this collection
bool AllowsDuplicates Value: True since this collection has bag semantics
object SyncRoot Value: The distinguished object to use for locking to synchronize multithreaded access
bool IsEmpty Value: True if this collection is empty.
int Count Value: The size of this collection
Speed CountSpeed Value: A characterization of the speed of the Count property in this collection.The value is symbolic indicating the type of asymptotic complexity in terms of the size of this collection (worst-case or amortized as relevant).

Constructor details

IntervalHeap<T>() Create an interval heap with natural item comparer and default initial capacity (16)
IntervalHeap<T>(IComparer<T> c) Create an interval heap with external item comparer and default initial capacity (16)
c: The external comparer
IntervalHeap<T>(int capacity) Create an interval heap with natural item comparer and prescribed initial capacity
capacity: The initial capacity
IntervalHeap<T>(IComparer<T> c, int capacity) Create an interval heap with external item comparer and prescribed initial capacity
c: The external comparer
capacity: The initial capacity

Method details

void AddAll<U>(System.Collections.Generic.IEnumerable<U> items) Add the elements from another collection with a more specialized item type to this collection.
items: The items to add
T FindMin() Find the current least item of this priority queue.
Throws System.InvalidOperationException if queue is empty
Returns: The least item.
T DeleteMin() Remove the least item from this priority queue.
Throws System.InvalidOperationException if queue is empty
Returns: The removed item.
T FindMax() Find the current largest item of this priority queue.
Throws System.InvalidOperationException if queue is empty
Returns: The largest item.
T DeleteMax() Remove the largest item from this priority queue.
Throws System.InvalidOperationException if queue is empty
Returns: The removed item.
bool Add(T item) Add an item to this priority queue.
Returns: True
item: The item to add.
void AddAll(System.Collections.Generic.IEnumerable<T> items) Add the elements from another collection to this collection.
items: The items to add.
System.Collections.Generic.IEnumerator<T> GetEnumerator() Create an enumerator for the collection Note: the enumerator does *not* enumerate the items in sorted order, but in the internal table order.
Returns: The enumerator(SIC)
bool Check() Check the integrity of the internal data structures of this collection. Only avaliable in DEBUG builds???
Returns: True if check does not fail.
void CopyTo(T[] a, int i) Inherited from CollectionValueBase{T}: void CopyTo(T[] a, int i)
T[] ToArray() Inherited from CollectionValueBase{T}: T[] ToArray()
void Apply(Applier<T> a) Inherited from CollectionValueBase{T}: void Apply(Applier<T> a)
bool Exists(Filter<T> filter) Inherited from CollectionValueBase{T}: bool Exists(Filter<T> filter)
bool All(Filter<T> filter) Inherited from CollectionValueBase{T}: bool All(Filter<T> filter)
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class IntHasher

A hasher for int32

Implements

IHasher<int>

Bases

object

Constructor overview

IntHasher()

Method overview

bool Equals(int i1, int i2), bool Equals(object obj), void Finalize(), int GetHashCode(int item), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), string ToString()

Constructor details

IntHasher()

Method details

int GetHashCode(int item) Get the hash code of this integer, i.e. itself
Returns: The same
item: The integer
bool Equals(int i1, int i2) Check if two integers are equal
Returns: True if equal
i1: first integer
i2: second integer
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class NaturalComparer<T>

A natural generic IComparer for an IComparable<T> item type

Implements

IComparer<T>

Bases

object

Constructor overview

NaturalComparer<T>()

Method overview

int Compare(T a, T b), bool Equals(object obj), void Finalize(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), string ToString()

Constructor details

NaturalComparer<T>()

Method details

int Compare(T a, T b) Compare two items
Returns: a <=> b
a: First item
b: Second item
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class NaturalComparerO<T>

A natural generic IComparer for a System.IComparable item type

Implements

IComparer<T>

Bases

object

Constructor overview

NaturalComparerO<T>()

Method overview

int Compare(T a, T b), bool Equals(object obj), void Finalize(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), string ToString()

Constructor details

NaturalComparerO<T>()

Method details

int Compare(T a, T b) Compare two items
Returns: a <=> b
a: First item
b: Second item
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class DefaultReferenceTypeHasher<T>

The default item hasher for a reference type. A trivial wrapper for calling the GetHashCode and Equals methods inherited from object.

Should only be instantiated with a reference type as generic type parameter. This is asserted at instatiation time in Debug builds.

Implements

IHasher<T>

Bases

object

Constructor overview

DefaultReferenceTypeHasher<T>()

Method overview

bool Equals(T i1, T i2), bool Equals(object obj), void Finalize(), int GetHashCode(T item), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), string ToString()

Constructor details

DefaultReferenceTypeHasher<T>()

Method details

int GetHashCode(T item) Get the hash code with respect to this item hasher
Returns: The hash code
item: The item
bool Equals(T i1, T i2) Check if two items are equal with respect to this item hasher
Returns: True if equal
i1: first item
i2: second item
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class DefaultValueTypeHasher<T>

The default item hasher for a value type. A trivial wrapper for calling the GetHashCode and Equals methods inherited from object.

Should only be instantiated with a value type as generic type parameter. This is asserted at instatiation time in Debug builds.

We cannot add the constraint "where T : struct" to get a compile time check because we need to instantiate this class in C5.HasherBuilder.ByPrototype[T].Examine() with a T that is only known at runtime to be a value type!

Implements

IHasher<T>

Bases

object

Constructor overview

DefaultValueTypeHasher<T>()

Method overview

bool Equals(T i1, T i2), bool Equals(object obj), void Finalize(), int GetHashCode(T item), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), string ToString()

Constructor details

DefaultValueTypeHasher<T>()

Method details

int GetHashCode(T item) Get the hash code with respect to this item hasher
Returns: The hash code
item: The item
bool Equals(T i1, T i2) Check if two items are equal with respect to this item hasher
Returns: True if equal
i1: first item
i2: second item
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class Sorting

A utility class with functions for sorting arrays with respect to an IComparer<T>

Bases

object

Constructor overview

Sorting()

Method overview

bool Equals(object obj), void Finalize(), int GetHashCode(), System.Type GetType(), void HeapSort<T>(T[] a, int f, int b, IComparer<T> c), void InsertionSort<T>(T[] a, int f, int b, IComparer<T> c), void IntroSort<T>(T[] a, int f, int b, IComparer<T> c), object MemberwiseClone(), string ToString()

Constructor details

Sorting()

Method details

NSvoid IntroSort<T>(T[] a, int f, int b, IComparer<T> c)
a:
f:
b:
c:
NSvoid InsertionSort<T>(T[] a, int f, int b, IComparer<T> c)
a:
f:
b:
c:
NSvoid HeapSort<T>(T[] a, int f, int b, IComparer<T> c)
a:
f:
b:
c:
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class C5Random

A modern random number generator based on (whatever)

Bases

object, System.Random

Constructor overview

C5Random(), C5Random(System.Int64 seed)

Method overview

bool Equals(object obj), void Finalize(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), int Next(), int Next(int max), int Next(int min, int max), void NextBytes(System.Byte[] buffer), double NextDouble(), double Sample(), string ToString()

Constructor details

C5Random() Create a random number generator seed by system time.
C5Random(System.Int64 seed) Create a random number generator with a given seed
seed: The seed

Method details

double NextDouble() Get a new random System.Double value
Returns: The random double
Pdouble Sample() Get a new random System.Double value
Returns: The random double
int Next() Get a new random System.Int32 value
Returns: The random int
int Next(int max) Get a random non-negative integer less than a given upper bound
Returns:
max: The upper bound (exclusive)
int Next(int min, int max) Get a random integer between two given bounds
Returns:
min: The lower bound (inclusive)
max: The upper bound (exclusive)
void NextBytes(System.Byte[] buffer) Fill a array of byte with random bytes
buffer: The array to fill
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class TestedAttribute

A custom attribute to mark methods and properties as being tested sufficiently in the regression test suite.

Bases

object, System.Attribute

Field overview

string via

Property overview

object TypeId

Constructor overview

TestedAttribute()

Method overview

bool Equals(object obj), void Finalize(), int GetHashCode(), System.Type GetType(), bool IsDefaultAttribute(), bool Match(object obj), object MemberwiseClone(), string ToString()

Field details

string via Optional reference to test case

Property details

object TypeId Inherited from System.Attribute: object TypeId

Constructor details

TestedAttribute()

Method details

string ToString() Pretty print attribute value
Returns: "Tested via " + via
bool Equals(object obj) Inherited from System.Attribute: bool Equals(object obj)
int GetHashCode() Inherited from System.Attribute: int GetHashCode()
bool Match(object obj) Inherited from System.Attribute: bool Match(object obj)
bool IsDefaultAttribute() Inherited from System.Attribute: bool IsDefaultAttribute()
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
Pvoid Finalize() Inherited from object: void Finalize()

Class SortedArray<T>

A collection class implementing a sorted dynamic array data structure.

Implements

System.Collections.Generic.IEnumerable<T>, ICollection<T>, ICollectionValue<T>, IDirectedCollectionValue<T>, IDirectedEnumerable<T>, IExtensible<T>, IIndexed<T>, IIndexedSorted<T>, IPriorityQueue<T>, ISequenced<T>, ISorted<T>

Bases

object, EnumerableBase<T>, CollectionValueBase<T>, CollectionBase<T>, SequencedBase<T>, ArrayBase<T>

Field overview

T[] array, bool isReadOnly, IHasher<T> itemhasher, int offset, int size, int stamp

Property overview

bool AllowsDuplicates, IComparer<T> Comparer, Speed ContainsSpeed, int Count, Speed CountSpeed, EnumerationDirection Direction, SortedArray<T>.Feature Features, bool IsEmpty, bool IsReadOnly, T this[int i], IDirectedCollectionValue<T> this[int start, int count], object SyncRoot

Constructor overview

SortedArray<T>(), SortedArray<T>(int capacity), SortedArray<T>(IComparer<T> c), SortedArray<T>(int capacity, IComparer<T> c), SortedArray<T>(int capacity, IComparer<T> c, IHasher<T> h)

Method overview

bool Add(T item), void AddAll<U>(System.Collections.Generic.IEnumerable<U> items), void AddAll(System.Collections.Generic.IEnumerable<T> items), void AddSorted(System.Collections.Generic.IEnumerable<T> items), bool All(Filter<T> filter), void Apply(Applier<T> a), IDirectedCollectionValue<T> Backwards(), bool Check(), void checkRange(int start, int count), void Clear(), bool Contains(T item), bool ContainsAll(System.Collections.Generic.IEnumerable<T> items), int ContainsCount(T item), void CopyTo(T[] a, int i), int CountFrom(T bot), int CountFromTo(T bot, T top), int CountTo(T top), bool Cut(System.IComparable<T> c, out T low, out bool lowIsValid, out T high, out bool highIsValid), T DeleteMax(), T DeleteMin(), bool Equals(object obj), bool Exists(Filter<T> filter), void expand(), void expand(int newcapacity, int newsize), void Finalize(), bool Find(ref T item), IIndexedSorted<T> FindAll(Filter<T> f), T FindMax(), T FindMin(), bool FindOrAdd(ref T item), System.Collections.Generic.IEnumerator<T> GetEnumerator(), int GetHashCode(), System.Type GetType(), int IndexOf(T item), void insert(int i, T item), int LastIndexOf(T item), IIndexedSorted<V> Map<V>(Mapper<T,V> m, IComparer<V> c), object MemberwiseClone(), void modifycheck(int thestamp), T Predecessor(T item), IDirectedCollectionValue<T> RangeAll(), IDirectedCollectionValue<T> RangeFrom(T bot), IDirectedCollectionValue<T> RangeFromTo(T bot, T top), IDirectedCollectionValue<T> RangeTo(T top), bool Remove(T item), void RemoveAll(System.Collections.Generic.IEnumerable<T> items), void RemoveAllCopies(T item), T RemoveAt(int i), void RemoveInterval(int start, int count), void RemoveRangeFrom(T low), void RemoveRangeFromTo(T low, T hi), void RemoveRangeTo(T hi), bool RemoveWithReturn(ref T item), void RetainAll(System.Collections.Generic.IEnumerable<T> items), bool sequencedequals(ISequenced<T> that), int sequencedhashcode(), T Successor(T item), T[] ToArray(), string ToString(), bool unsequencedequals(ICollection<T> that), int unsequencedhashcode(), bool Update(T item), void updatecheck(), bool UpdateOrAdd(T item), T WeakPredecessor(T item), T WeakSuccessor(T item)

Field details

PT[] array Inherited from ArrayBase{T}: T[] array
Pint offset Inherited from ArrayBase{T}: int offset
Pbool isReadOnly Inherited from CollectionBase{T}: bool isReadOnly
Pint stamp Inherited from CollectionBase{T}: int stamp
Pint size Inherited from CollectionBase{T}: int size
PIHasher<T> itemhasher Inherited from CollectionBase{T}: IHasher<T> itemhasher

Property details

SortedArray<T>.Feature Features Value: A debugging artifact. To be removed.
Speed ContainsSpeed Value: Speed.LogThe value is symbolic indicating the type of asymptotic complexity in terms of the size of this collection (worst-case).
bool AllowsDuplicates Value: False since this collection has set semantics
IComparer<T> Comparer Value: The comparerThe comparer object supplied at creation time for this collection
T this[int i] Value: The i'th item of this list.
Throws System.IndexOutOfRangeException if i is negative or >= the size of the collection.
i: the index to lookup
IDirectedCollectionValue<T> this[int start, int count] Inherited from ArrayBase{T}: IDirectedCollectionValue<T> this[int start, int count]
EnumerationDirection Direction Inherited from SequencedBase{T}: EnumerationDirection Direction
bool IsReadOnly Inherited from CollectionBase{T}: bool IsReadOnly
int Count Inherited from CollectionBase{T}: int Count
Speed CountSpeed Inherited from CollectionBase{T}: Speed CountSpeed
object SyncRoot Inherited from CollectionBase{T}: object SyncRoot
bool IsEmpty Inherited from CollectionBase{T}: bool IsEmpty

Constructor details

SortedArray<T>() Create a dynamic sorted array with a natural comparer
SortedArray<T>(int capacity) Create a dynamic sorted array with a natural comparer and prescribed initial capacity.
capacity: The capacity
SortedArray<T>(IComparer<T> c) Create a dynamic sorted array with an external comparer
c: The comparer
SortedArray<T>(int capacity, IComparer<T> c) Create a dynamic sorted array with an external comparer and prescribed initial capacity.
capacity: The capacity
c: The comparer
SortedArray<T>(int capacity, IComparer<T> c, IHasher<T> h) Create a dynamic sorted array with an external comparer, an external hasher and prescribed initial capacity.
capacity: The capacity
c: The comparer
h: The hasher (compatible)

Method details

IIndexedSorted<V> Map<V>(Mapper<T,V> m, IComparer<V> c) Create a new indexed sorted collection consisting of the results of mapping all items of this list.
Throws System.ArgumentException if the map is not increasing over the items of this collection (with respect to the two given comparison relations).
Returns: The new sorted collection.
m: The delegate definging the map.
c: The comparion relation to use for the result.
void AddAll<U>(System.Collections.Generic.IEnumerable<U> items) Add the elements from another collection with a more specialized item type to this collection. Since this collection has set semantics, only items not already in the collection will be added.
items: The items to add
int CountFrom(T bot) Determine the number of items at or above a supplied threshold.
Returns: The number of matcing items.
bot: The lower bound (inclusive)
int CountFromTo(T bot, T top) Determine the number of items between two supplied thresholds.
Returns: The number of matcing items.
bot: The lower bound (inclusive)
top: The upper bound (exclusive)
int CountTo(T top) Determine the number of items below a supplied threshold.
Returns: The number of matcing items.
top: The upper bound (exclusive)
IDirectedCollectionValue<T> RangeFrom(T bot) Query this sorted collection for items greater than or equal to a supplied value.
Returns: The result directed collection.
bot: The lower bound (inclusive).
IDirectedCollectionValue<T> RangeFromTo(T bot, T top) Query this sorted collection for items between two supplied values.
Returns: The result directed collection.
bot: The lower bound (inclusive).
top: The upper bound (exclusive).
IDirectedCollectionValue<T> RangeTo(T top) Query this sorted collection for items less than a supplied value.
Returns: The result directed collection.
top: The upper bound (exclusive).
IIndexedSorted<T> FindAll(Filter<T> f) Create a new indexed sorted collection consisting of the items of this indexed sorted collection satisfying a certain predicate.
Returns: The new indexed sorted collection.
f: The filter delegate defining the predicate.
T Predecessor(T item) Find the strict predecessor in the sorted collection of a particular value, i.e. the largest item in the collection less than the supplied value.
Throws System.InvalidOperationException if no such element exists (the supplied value is less than or equal to the minimum of this collection.)
Returns: The predecessor.
item: The item to find the predecessor for.
T Successor(T item) Find the strict successor in the sorted collection of a particular value, i.e. the least item in the collection greater than the supplied value.
Throws System.InvalidOperationException if no such element exists (the supplied value is greater than or equal to the maximum of this collection.)
Returns: The successor.
item: The item to find the successor for.
T WeakPredecessor(T item) Find the weak predecessor in the sorted collection of a particular value, i.e. the largest item in the collection less than or equal to the supplied value.
Throws System.InvalidOperationException if no such element exists (the supplied value is less than the minimum of this collection.)
Returns: The weak predecessor.
item: The item to find the weak predecessor for.
T WeakSuccessor(T item) Find the weak successor in the sorted collection of a particular value, i.e. the least item in the collection greater than or equal to the supplied value.
Throws System.InvalidOperationException if no such element exists (the supplied value is greater than the maximum of this collection.)
Returns: The weak successor.
item: The item to find the weak successor for.
bool Cut(System.IComparable<T> c, out T low, out bool lowIsValid, out T high, out bool highIsValid) Perform a search in the sorted collection for the ranges in which a non-decreasing function from the item type to int is negative, zero respectively positive. If the supplied cut function is not non-decreasing, the result of this call is undefined.
Returns:
c: The cut function T to int, given as an IComparable<T> object, where the cut function is the c.CompareTo(T that) method.
low: Returns the largest item in the collection, where the cut function is negative (if any).
lowIsValid: True if the cut function is negative somewhere on this collection.
high: Returns the least item in the collection, where the cut function is positive (if any).
highIsValid: True if the cut function is positive somewhere on this collection.
IDirectedCollectionValue<T> RangeAll() Create a directed collection with the same items as this collection.
Returns: The result directed collection.
void AddSorted(System.Collections.Generic.IEnumerable<T> items) Add all the items from another collection with an enumeration order that is increasing in the items.
Throws System.ArgumentException if the enumerated items turns out not to be in increasing order.
items: The collection to add.
void RemoveRangeFrom(T low) Remove all items of this collection above or at a supplied threshold.
low: The lower threshold (inclusive).
void RemoveRangeFromTo(T low, T hi) Remove all items of this collection between two supplied thresholds.
low: The lower threshold (inclusive).
hi: The upper threshold (exclusive).
void RemoveRangeTo(T hi) Remove all items of this collection below a supplied threshold.
hi: The upper threshold (exclusive).
bool Contains(T item) Check if this collection contains (an item equivalent to according to the itemhasher) a particular value.
Returns: True if the items is in this collection.
item: The value to check for.
bool Find(ref T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, return in the ref argument (a binary copy of) the actual value found.
Returns: True if the items is in this collection.
item: The value to look for.
bool FindOrAdd(ref T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, return in the ref argument (a binary copy of) the actual value found. Else, add the item to the collection.
Returns: True if the item was added (hence not found).
item: The value to look for.
bool Update(T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, update the item in the collection to with a binary copy of the supplied value. If the collection has bag semantics, it is implementation dependent if this updates all equivalent copies in the collection or just one.
Returns: True if the item was found and hence updated.
item: Value to update.
bool UpdateOrAdd(T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, update the item in the collection to with a binary copy of the supplied value; else add the value to the collection.
Returns: True if the item was found and updated (hence not added).
item: Value to add or update.
bool Remove(T item) Remove a particular item from this collection. If the collection has bag semantics only one copy equivalent to the supplied item is removed.
Returns: True if the item was found (and removed).
item: The value to remove.
bool RemoveWithReturn(ref T item) Remove a particular item from this collection if found. If the collection has bag semantics only one copy equivalent to the supplied item is removed, which one is implementation dependent. If an item was removed, report a binary copy of the actual item removed in the argument.
Returns: True if the item was found (and removed).
item: The value to remove on input.
void RemoveAll(System.Collections.Generic.IEnumerable<T> items) Remove all items in another collection from this one.
items: The items to remove.
void RetainAll(System.Collections.Generic.IEnumerable<T> items) Remove all items not in some other collection from this one.
items: The items to retain.
bool ContainsAll(System.Collections.Generic.IEnumerable<T> items) Check if this collection contains all the values in another collection. Multiplicities are not taken into account.
Returns: True if all values in itemsis in this collection.
items: The
int ContainsCount(T item) Count the number of items of the collection equal to a particular value. Returns 0 if and only if the value is not in the collection.
Returns: The number of copies found (0 or 1).
item: The value to count.
void RemoveAllCopies(T item) Remove all (0 or 1) items equivalent to a given value.
item: The value to remove.
bool Check() Check the integrity of the internal data structures of this collection. Only avaliable in DEBUG builds???
Returns: True if check does not fail.
bool Add(T item) Add an item to this collection if possible. If this collection has set semantics, the item will be added if not already in the collection. If bag semantics, the item will always be added.
Returns: True if item was added.
item: The item to add.
void AddAll(System.Collections.Generic.IEnumerable<T> items) Add the elements from another collection to this collection. If this collection has set semantics, only items not already in the collection will be added.
items: The items to add.
T FindMin() Find the current least item of this priority queue.
Returns: The least item.
T DeleteMin() Remove the least item from this priority queue.
Returns: The removed item.
T FindMax() Find the current largest item of this priority queue.
Returns: The largest item.
T DeleteMax() Remove the largest item from this priority queue.
Returns: The removed item.
int IndexOf(T item) Searches for an item in the list going forwrds from the start.
Returns: Index of item from start.
item: Item to search for.
int LastIndexOf(T item) Searches for an item in the list going backwords from the end.
Returns: Index of of item from the end.
item: Item to search for.
T RemoveAt(int i) Remove the item at a specific position of the list.
Throws System.IndexOutOfRangeException if i is negative or >= the size of the collection.
Returns: The removed item.
i: The index of the item to remove.
void RemoveInterval(int start, int count) Remove all items in an index interval.
Throws System.IndexOutOfRangeException???.
start: The index of the first item to remove.
count: The number of items to remove.
Pvoid expand() Inherited from ArrayBase{T}: void expand()
Pvoid expand(int newcapacity, int newsize) Inherited from ArrayBase{T}: void expand(int newcapacity, int newsize)
Pvoid insert(int i, T item) Inherited from ArrayBase{T}: void insert(int i, T item)
void Clear() Inherited from ArrayBase{T}: void Clear()
T[] ToArray() Inherited from ArrayBase{T}: T[] ToArray()
IDirectedCollectionValue<T> Backwards() Inherited from ArrayBase{T}: IDirectedCollectionValue<T> Backwards()
System.Collections.Generic.IEnumerator<T> GetEnumerator() Inherited from ArrayBase{T}: System.Collections.Generic.IEnumerator<T> GetEnumerator()
NPint sequencedhashcode() Inherited from SequencedBase{T}: int sequencedhashcode()
NPbool sequencedequals(ISequenced<T> that) Inherited from SequencedBase{T}: bool sequencedequals(ISequenced<T> that)
NPvoid checkRange(int start, int count) Inherited from CollectionBase{T}: void checkRange(int start, int count)
NPint unsequencedhashcode() Inherited from CollectionBase{T}: int unsequencedhashcode()
NPbool unsequencedequals(ICollection<T> that) Inherited from CollectionBase{T}: bool unsequencedequals(ICollection<T> that)
Pvoid modifycheck(int thestamp) Inherited from CollectionBase{T}: void modifycheck(int thestamp)
Pvoid updatecheck() Inherited from CollectionBase{T}: void updatecheck()
void CopyTo(T[] a, int i) Inherited from CollectionValueBase{T}: void CopyTo(T[] a, int i)
void Apply(Applier<T> a) Inherited from CollectionValueBase{T}: void Apply(Applier<T> a)
bool Exists(Filter<T> filter) Inherited from CollectionValueBase{T}: bool Exists(Filter<T> filter)
bool All(Filter<T> filter) Inherited from CollectionValueBase{T}: bool All(Filter<T> filter)
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class HashedArrayList<T>

A set collection based on a dynamic array combined with a hash index for item to index lookup.

Implements

System.Collections.Generic.IEnumerable<T>, ICollection<T>, ICollectionValue<T>, IDirectedCollectionValue<T>, IDirectedEnumerable<T>, IExtensible<T>, IIndexed<T>, IList<T>, IQueue<T>, ISequenced<T>, IStack<T>

Bases

object, EnumerableBase<T>, CollectionValueBase<T>, CollectionBase<T>, SequencedBase<T>, ArrayBase<T>, ArrayList<T>

Field overview

T[] array, bool fIFO, bool isReadOnly, IHasher<T> itemhasher, int offset, int size, int stamp, ArrayList<T> underlying, int underlyingsize

Property overview

bool AllowsDuplicates, Speed ContainsSpeed, int Count, Speed CountSpeed, EnumerationDirection Direction, bool FIFO, T First, bool IsEmpty, bool IsReadOnly, T this[int i], IDirectedCollectionValue<T> this[int start, int count], T Last, int Offset, object SyncRoot, IList<T> Underlying

Constructor overview

HashedArrayList<T>(), HashedArrayList<T>(int cap), HashedArrayList<T>(IHasher<T> hasher), HashedArrayList<T>(int capacity, IHasher<T> hasher)

Method overview

bool Add(T item), void AddAll(System.Collections.Generic.IEnumerable<T> items), void addtosize(int delta), bool All(Filter<T> filter), void Apply(Applier<T> a), IDirectedCollectionValue<T> Backwards(), bool Check(), void checkRange(int start, int count), void Clear(), bool Contains(T item), bool ContainsAll(System.Collections.Generic.IEnumerable<T> items), int ContainsCount(T item), void CopyTo(T[] a, int i), T DeQueue(), void EnQueue(T item), bool Equals(object obj), bool Exists(Filter<T> filter), void expand(), void expand(int newcapacity, int newsize), void Finalize(), bool Find(ref T item), IList<T> FindAll(Filter<T> filter), bool FindOrAdd(ref T item), System.Collections.Generic.IEnumerator<T> GetEnumerator(), int GetHashCode(), System.Type GetType(), int indexOf(T item), int IndexOf(T item), void insert(int i, T item), void Insert(int i, T item), void InsertAfter(T item, T target), void InsertAll(int i, System.Collections.Generic.IEnumerable<T> items), void InsertBefore(T item, T target), void InsertFirst(T item), void InsertLast(T item), bool IsSorted(IComparer<T> c), int lastIndexOf(T item), int LastIndexOf(T item), IList<V> Map<V>(Mapper<T,V> mapper), IList<V> Map<V>(Mapper<T,V> mapper, IHasher<V> hasher), object MemberwiseClone(), void modifycheck(), void modifycheck(int stamp), T Pop(), void Push(T item), bool Remove(T item), T Remove(), void RemoveAll(System.Collections.Generic.IEnumerable<T> items), void RemoveAllCopies(T item), T removeAt(int i), T RemoveAt(int i), T RemoveFirst(), void RemoveInterval(int start, int count), T RemoveLast(), bool RemoveWithReturn(ref T item), void RetainAll(System.Collections.Generic.IEnumerable<T> items), void Reverse(int start, int count), void Reverse(), bool sequencedequals(ISequenced<T> that), int sequencedhashcode(), void Shuffle(System.Random rnd), void Shuffle(), void Slide(int offset), void Slide(int offset, int size), void Sort(IComparer<T> c), T[] ToArray(), string ToString(), bool unsequencedequals(ICollection<T> that), int unsequencedhashcode(), bool Update(T item), void updatecheck(), bool UpdateOrAdd(T item), IList<T> View(int start, int count)

Field details

PArrayList<T> underlying Inherited from ArrayList{T}: ArrayList<T> underlying
Pint underlyingsize Inherited from ArrayList{T}: int underlyingsize
Pbool fIFO Inherited from ArrayList{T}: bool fIFO
PT[] array Inherited from ArrayBase{T}: T[] array
Pint offset Inherited from ArrayBase{T}: int offset
Pbool isReadOnly Inherited from CollectionBase{T}: bool isReadOnly
Pint stamp Inherited from CollectionBase{T}: int stamp
Pint size Inherited from CollectionBase{T}: int size
PIHasher<T> itemhasher Inherited from CollectionBase{T}: IHasher<T> itemhasher

Property details

Speed ContainsSpeed Value: Speed.ConstantThe value is symbolic indicating the type of asymptotic complexity in terms of the size of this collection (expected).
bool AllowsDuplicates Value: False, indicating hashed array list has set semantics.
T First Inherited from ArrayList{T}: T First
T Last Inherited from ArrayList{T}: T Last
bool FIFO Inherited from ArrayList{T}: bool FIFO
T this[int i] Inherited from ArrayList{T}: T this[int i]
IList<T> Underlying Inherited from ArrayList{T}: IList<T> Underlying
int Offset Inherited from ArrayList{T}: int Offset
IDirectedCollectionValue<T> this[int start, int count] Inherited from ArrayBase{T}: IDirectedCollectionValue<T> this[int start, int count]
EnumerationDirection Direction Inherited from SequencedBase{T}: EnumerationDirection Direction
bool IsReadOnly Inherited from CollectionBase{T}: bool IsReadOnly
int Count Inherited from CollectionBase{T}: int Count
Speed CountSpeed Inherited from CollectionBase{T}: Speed CountSpeed
object SyncRoot Inherited from CollectionBase{T}: object SyncRoot
bool IsEmpty Inherited from CollectionBase{T}: bool IsEmpty

Constructor details

HashedArrayList<T>() Create a hashed array list with the natural hasher
HashedArrayList<T>(int cap) Create a hashed array list with the natural hasher and specified capacity
cap: The initial capacity
HashedArrayList<T>(IHasher<T> hasher) Create a hashed array list with an external hasher
hasher: The external hasher
HashedArrayList<T>(int capacity, IHasher<T> hasher) Create a hashed array list with an external hasher and specified capacity
capacity: The initial capacity
hasher: The external hasher

Method details

Pint indexOf(T item) Internal version of IndexOf without modification checks.
Returns: The index of first occurrence
item: Item to look for
Pint lastIndexOf(T item) Internal version of LastIndexOf without modification checks.
Returns: The index of last occurrence
item: Item to look for
Pvoid insert(int i, T item) Internal version of Insert with no modification checks.
Throws System.ArgumentException if item already in list.
i: Index to insert at
item: Item to insert
PT removeAt(int i) Internal version of RemoveAt with no modification checks.
Returns: The removed item
i: Index to remove at
void InsertAll(int i, System.Collections.Generic.IEnumerable<T> items) Insert into this list all items from an enumerable collection starting at a particular index.
Throws System.IndexOutOfRangeException if i is negative or > the size of the collection.
Throws System.InvalidOperationException if one of the items to insert is already in the list.
i: Index to start inserting at
items: Items to insert
void InsertBefore(T item, T target) Insert an item right before the first occurrence of some target item.
Throws System.ArgumentException if target is not found.
Throws System.InvalidOperationException if the item to insert is already in the list.
item: The item to insert.
target: The target before which to insert.
void InsertAfter(T item, T target) Insert an item right after the last(???) occurrence of some target item.
Throws System.ArgumentException if target is not found.
Throws System.InvalidOperationException if the item to insert is already in the list.
item: The item to insert.
target: The target after which to insert.
IList<T> View(int start, int count) Create a list view on this list.
Throws System.ArgumentOutOfRangeException if the view would not fit into this list.
Returns: The new list view.
start: The index in this list of the start of the view.
count: The size of the view.
void Reverse(int start, int count) Reverst part of the list so the items are in the opposite sequence order.
Throws System.ArgumentException if the count is negative.
Throws System.ArgumentOutOfRangeException if the part does not fit into the list.
start: The index of the start of the part to reverse.
count: The size of the part to reverse.
void Sort(IComparer<T> c) Sort the items of the list according to a specific sorting order.
c: The comparer defining the sorting order.
void Shuffle(System.Random rnd) Shuffle the items of this list according to a specific random source.
rnd: The random source.
void RemoveInterval(int start, int count) Remove all items in an index interval.
Throws System.IndexOutOfRangeException???.
start: The index of the first item to remove.
count: The number of items to remove.
bool Contains(T item) Check if this collection contains (an item equivalent to according to the itemhasher) a particular value.
Returns: True if the items is in this collection.
item: The value to check for.
bool Remove(T item) Remove the first copy of a particular item from this collection.
Returns: True if the item was found (and removed).
item: The value to remove.
void RemoveAll(System.Collections.Generic.IEnumerable<T> items) Remove all items in another collection from this one, taking multiplicities into account. Matching items will be removed from the front. Current implementation is not optimal.
items: The items to remove.
void Clear() Remove all items from this collection, resetting internal array size.
void RetainAll(System.Collections.Generic.IEnumerable<T> items) Remove all items not in some other collection from this one.
items: The items to retain.
bool ContainsAll(System.Collections.Generic.IEnumerable<T> items) Check if this collection contains all the values in another collection.
Returns: True if all values in itemsis in this collection.
items: The
int ContainsCount(T item) Count the number of items of the collection equal to a particular value. Returns 0 if and only if the value is not in the collection.
Returns: The number of copies found (0 or 1).
item: The value to count.
void RemoveAllCopies(T item) Remove all items equal to a given one.
item: The value to remove.
bool Check() Check the integrity of the internal data structures of this array list.
Returns: True if check does not fail.
bool Add(T item) Add an item to end of this list if not already in list.
Returns: True if item was added
item: The item to add.
IList<V> Map<V>(Mapper<T,V> mapper) Inherited from ArrayList{T}: IList<V> Map<V>(Mapper<T,V> mapper)
IList<V> Map<V>(Mapper<T,V> mapper, IHasher<V> hasher) Inherited from ArrayList{T}: IList<V> Map<V>(Mapper<T,V> mapper, IHasher<V> hasher)
Pvoid expand() Inherited from ArrayList{T}: void expand()
Pvoid expand(int newcapacity, int newsize) Inherited from ArrayList{T}: void expand(int newcapacity, int newsize)
Pvoid updatecheck() Inherited from ArrayList{T}: void updatecheck()
NPvoid modifycheck() Inherited from ArrayList{T}: void modifycheck()
Pvoid modifycheck(int stamp) Inherited from ArrayList{T}: void modifycheck(int stamp)
NPvoid addtosize(int delta) Inherited from ArrayList{T}: void addtosize(int delta)
void Insert(int i, T item) Inherited from ArrayList{T}: void Insert(int i, T item)
void InsertFirst(T item) Inherited from ArrayList{T}: void InsertFirst(T item)
void InsertLast(T item) Inherited from ArrayList{T}: void InsertLast(T item)
IList<T> FindAll(Filter<T> filter) Inherited from ArrayList{T}: IList<T> FindAll(Filter<T> filter)
T Remove() Inherited from ArrayList{T}: T Remove()
T RemoveFirst() Inherited from ArrayList{T}: T RemoveFirst()
T RemoveLast() Inherited from ArrayList{T}: T RemoveLast()
void Slide(int offset) Inherited from ArrayList{T}: void Slide(int offset)
void Slide(int offset, int size) Inherited from ArrayList{T}: void Slide(int offset, int size)
void Reverse() Inherited from ArrayList{T}: void Reverse()
bool IsSorted(IComparer<T> c) Inherited from ArrayList{T}: bool IsSorted(IComparer<T> c)
void Shuffle() Inherited from ArrayList{T}: void Shuffle()
int IndexOf(T item) Inherited from ArrayList{T}: int IndexOf(T item)
int LastIndexOf(T item) Inherited from ArrayList{T}: int LastIndexOf(T item)
T RemoveAt(int i) Inherited from ArrayList{T}: T RemoveAt(int i)
bool Find(ref T item) Inherited from ArrayList{T}: bool Find(ref T item)
bool Update(T item) Inherited from ArrayList{T}: bool Update(T item)
bool FindOrAdd(ref T item) Inherited from ArrayList{T}: bool FindOrAdd(ref T item)
bool UpdateOrAdd(T item) Inherited from ArrayList{T}: bool UpdateOrAdd(T item)
bool RemoveWithReturn(ref T item) Inherited from ArrayList{T}: bool RemoveWithReturn(ref T item)
void AddAll(System.Collections.Generic.IEnumerable<T> items) Inherited from ArrayList{T}: void AddAll(System.Collections.Generic.IEnumerable<T> items)
void Push(T item) Inherited from ArrayList{T}: void Push(T item)
T Pop() Inherited from ArrayList{T}: T Pop()
void EnQueue(T item) Inherited from ArrayList{T}: void EnQueue(T item)
T DeQueue() Inherited from ArrayList{T}: T DeQueue()
T[] ToArray() Inherited from ArrayBase{T}: T[] ToArray()
IDirectedCollectionValue<T> Backwards() Inherited from ArrayBase{T}: IDirectedCollectionValue<T> Backwards()
System.Collections.Generic.IEnumerator<T> GetEnumerator() Inherited from ArrayBase{T}: System.Collections.Generic.IEnumerator<T> GetEnumerator()
NPint sequencedhashcode() Inherited from SequencedBase{T}: int sequencedhashcode()
NPbool sequencedequals(ISequenced<T> that) Inherited from SequencedBase{T}: bool sequencedequals(ISequenced<T> that)
NPvoid checkRange(int start, int count) Inherited from CollectionBase{T}: void checkRange(int start, int count)
NPint unsequencedhashcode() Inherited from CollectionBase{T}: int unsequencedhashcode()
NPbool unsequencedequals(ICollection<T> that) Inherited from CollectionBase{T}: bool unsequencedequals(ICollection<T> that)
void CopyTo(T[] a, int i) Inherited from CollectionValueBase{T}: void CopyTo(T[] a, int i)
void Apply(Applier<T> a) Inherited from CollectionValueBase{T}: void Apply(Applier<T> a)
bool Exists(Filter<T> filter) Inherited from CollectionValueBase{T}: bool Exists(Filter<T> filter)
bool All(Filter<T> filter) Inherited from CollectionValueBase{T}: bool All(Filter<T> filter)
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class LinkedList<T>

A list collection class based on a doubly linked list data structure.

Implements

System.Collections.Generic.IEnumerable<T>, ICollection<T>, ICollectionValue<T>, IDirectedCollectionValue<T>, IDirectedEnumerable<T>, IExtensible<T>, IIndexed<T>, IList<T>, IQueue<T>, ISequenced<T>, IStack<T>

Bases

object, EnumerableBase<T>, CollectionValueBase<T>, CollectionBase<T>, SequencedBase<T>

Base of

HashedLinkedList<T>

Field overview

LinkedList<T>.Node endsentinel, bool isReadOnly, IHasher<T> itemhasher, bool maintaintags, int offset, int size, int stamp, LinkedList<T>.Node startsentinel, LinkedList<T> underlying

Property overview

bool AllowsDuplicates, Speed ContainsSpeed, int Count, Speed CountSpeed, EnumerationDirection Direction, bool FIFO, T First, bool IsEmpty, bool IsReadOnly, T this[int index], IDirectedCollectionValue<T> this[int start, int count], T Last, int Offset, object SyncRoot, IList<T> Underlying

Constructor overview

LinkedList<T>(IHasher<T> itemhasher), LinkedList<T>()

Method overview

bool Add(T item), void AddAll<U>(System.Collections.Generic.IEnumerable<U> items), void AddAll(System.Collections.Generic.IEnumerable<T> items), bool All(Filter<T> filter), void Apply(Applier<T> a), IDirectedCollectionValue<T> Backwards(), bool Check(), void checkRange(int start, int count), void Clear(), bool Contains(T item), bool ContainsAll(System.Collections.Generic.IEnumerable<T> items), int ContainsCount(T item), void CopyTo(T[] a, int i), T DeQueue(), void EnQueue(T item), bool Equals(object obj), bool Exists(Filter<T> filter), void Finalize(), bool Find(ref T item), IList<T> FindAll(Filter<T> filter), bool FindOrAdd(ref T item), LinkedList<T>.Node get(int n), System.Collections.Generic.IEnumerator<T> GetEnumerator(), int GetHashCode(), LinkedList<T>.TagGroup gettaggroup(LinkedList<T>.Node pred, LinkedList<T>.Node succ, out int lowbound, out int highbound), System.Type GetType(), int IndexOf(T item), void Insert(int i, T item), void InsertAfter(T item, T target), void InsertAll(int i, System.Collections.Generic.IEnumerable<T> items), void InsertBefore(T item, T target), void InsertFirst(T item), void InsertLast(T item), void insertNode(LinkedList<T>.Node succ, LinkedList<T>.Node newnode), bool IsSorted(IComparer<T> c), int LastIndexOf(T item), IList<V> Map<V>(Mapper<T,V> mapper), IList<V> Map<V>(Mapper<T,V> mapper, IHasher<V> hasher), object MemberwiseClone(), void modifycheck(), void modifycheck(int stamp), T Pop(), void Push(T item), T remove(LinkedList<T>.Node node), T Remove(), bool Remove(T item), void RemoveAll(System.Collections.Generic.IEnumerable<T> items), void RemoveAllCopies(T item), T RemoveAt(int i), T RemoveFirst(), void removefromtaggroup(LinkedList<T>.Node node), void RemoveInterval(int start, int count), T RemoveLast(), bool RemoveWithReturn(ref T item), void RetainAll(System.Collections.Generic.IEnumerable<T> items), void Reverse(), void Reverse(int start, int count), bool sequencedequals(ISequenced<T> that), int sequencedhashcode(), void settag(LinkedList<T>.Node node), void Shuffle(), void Shuffle(System.Random rnd), void Slide(int offset), void Slide(int offset, int size), void Sort(IComparer<T> c), void splittaggroup(LinkedList<T>.TagGroup taggroup), T[] ToArray(), string ToString(), bool unsequencedequals(ICollection<T> that), int unsequencedhashcode(), bool Update(T item), void updatecheck(), bool UpdateOrAdd(T item), IList<T> View(int start, int count)

Field details

Pbool maintaintags True if we maintain tags for node ordering (false for plain linked list, true for hashed linked list).
PLinkedList<T>.Node startsentinel Node to the left of first node
PLinkedList<T>.Node endsentinel Node to the right of last node
Pint offset Offset of this view in underlying list
PLinkedList<T> underlying underlying list of theis view (or null)
Pbool isReadOnly Inherited from CollectionBase{T}: bool isReadOnly
Pint stamp Inherited from CollectionBase{T}: int stamp
Pint size Inherited from CollectionBase{T}: int size
PIHasher<T> itemhasher Inherited from CollectionBase{T}: IHasher<T> itemhasher

Property details

T First Value: The first item in this list.
Throws System.InvalidOperationException if this list is empty.
T Last Value: The last item in this list.
Throws System.InvalidOperationException if this list is empty.
bool FIFO Value: True if the Remove() operation removes from the start of the list, false if it removes from the end.Since Add(T item) always add at the end of the list, this describes if list has FIFO or LIFO semantics.
T this[int index] Value: The i'th item of this list.On this list, this indexer is read/write.
Throws System.IndexOutOfRangeException if i is negative or >= the size of the collection.
index: The index of the item to fetch or store.
IList<T> Underlying Value: Underlying list for view.Null if this list is not a view.
int Offset Value: Offset for this list view or 0 for a underlying list.
IDirectedCollectionValue<T> this[int start, int count] Value: The directed collection of items in a specific index interval.
Throws System.IndexOutOfRangeException.
start: The low index of the interval (inclusive).
count: The size of the range.
Speed ContainsSpeed Value: Speed.LinearThe value is symbolic indicating the type of asymptotic complexity in terms of the size of this collection (worst-case or amortized as relevant).
int Count Value: The number of items in this collection
bool AllowsDuplicates Value: True since this collection has bag semantics.
EnumerationDirection Direction Inherited from SequencedBase{T}: EnumerationDirection Direction
bool IsReadOnly Inherited from CollectionBase{T}: bool IsReadOnly
Speed CountSpeed Inherited from CollectionBase{T}: Speed CountSpeed
object SyncRoot Inherited from CollectionBase{T}: object SyncRoot
bool IsEmpty Inherited from CollectionBase{T}: bool IsEmpty

Constructor details

LinkedList<T>(IHasher<T> itemhasher) Create a linked list with en external item hasher
itemhasher: The external hasher
LinkedList<T>() Create a linked list with the nmatural item hasher

Method details

IList<V> Map<V>(Mapper<T,V> mapper) Create a new list consisting of the results of mapping all items of this list.
Returns: The new list.
mapper: The delegate definging the map.
IList<V> Map<V>(Mapper<T,V> mapper, IHasher<V> hasher) Create a new list consisting of the results of mapping all items of this list. The new list will use a specified hasher for the item type.
Returns: The new list.
mapper: The delegate defining the map.
hasher: The hasher to use for the new list
void AddAll<U>(System.Collections.Generic.IEnumerable<U> items) Add the elements from another collection with a more specialized item type to this collection.
items: The items to add
Pvoid updatecheck() Check if it is valid to perform updates and increment stamp.
Throws System.InvalidOperationException if check fails.
This method should be called at the start of any public modifying methods.
NPvoid modifycheck() Check if we are a view that the underlyinglist has only been updated through us.
Throws System.InvalidOperationException if check fails.
This method should be called from enumerators etc to guard against modification of the base collection.
Pvoid modifycheck(int stamp) Check that the list has not been updated since a particular time.
Throws System.InvalidOperationException if check fails.
stamp: The stamp indicating the time.
NPvoid insertNode(LinkedList<T>.Node succ, LinkedList<T>.Node newnode)
succ:
newnode:
NPT remove(LinkedList<T>.Node node)
Returns:
node:
NPLinkedList<T>.TagGroup gettaggroup(LinkedList<T>.Node pred, LinkedList<T>.Node succ, out int lowbound, out int highbound)
Returns:
pred:
succ:
lowbound:
highbound:
NPvoid settag(LinkedList<T>.Node node)
node:
NPvoid removefromtaggroup(LinkedList<T>.Node node)
node:
NPvoid splittaggroup(LinkedList<T>.TagGroup taggroup)
taggroup:
NPLinkedList<T>.Node get(int n) Return the node at position n
Returns:
n:
void Insert(int i, T item) Insert an item at a specific index location in this list.
Throws System.IndexOutOfRangeException if i is negative or > the size of the collection.
i: The index at which to insert.
item: The item to insert.
void InsertAll(int i, System.Collections.Generic.IEnumerable<T> items) Insert into this list all items from an enumerable collection starting at a particular index.
Throws System.IndexOutOfRangeException if i is negative or > the size of the collection.
i: Index to start inserting at
items: Items to insert
void InsertBefore(T item, T target) Insert an item right before the first occurrence of some target item.
Throws System.ArgumentException if target is not found
item: The item to insert.
target: The target before which to insert.
void InsertAfter(T item, T target) Insert an item right after the last(???) occurrence of some target item.
Throws System.ArgumentException if target is not found
item: The item to insert.
target: The target after which to insert.
void InsertFirst(T item) Insert an item at the front of this list.
item: The item to insert.
void InsertLast(T item) Insert an item at the back of this list.
item: The item to insert.
T Remove() Remove one item from the list: from the front if FIFO is true, else from the back.
Throws System.InvalidOperationException if this list is empty.
Returns: The removed item.
T RemoveFirst() Remove one item from the front of the list.
Throws System.InvalidOperationException if this list is empty.
Returns: The removed item.
T RemoveLast() Remove one item from the back of the list.
Throws System.InvalidOperationException if this list is empty.
Returns: The removed item.
IList<T> View(int start, int count) Create a list view on this list.
Throws System.ArgumentOutOfRangeException if the start or count is negative
Throws System.ArgumentException if the range does not fit within list.
Returns: The new list view.
start: The index in this list of the start of the view.
count: The size of the view.
void Slide(int offset) Slide this list view along the underlying list.
Throws System.InvalidOperationException if this list is not a view.
Throws System.ArgumentOutOfRangeException if the operation would bring either end of the view outside the underlying list.
offset: The signed amount to slide: positive to slide towards the end.
void Slide(int offset, int size) Slide this list view along the underlying list, changing its size.
Throws System.InvalidOperationException if this list is not a view.
Throws System.ArgumentOutOfRangeException if the operation would bring either end of the view outside the underlying list.
offset: The signed amount to slide: positive to slide towards the end.
size: The new size of the view.
void Reverse() Reverse the list so the items are in the opposite sequence order.
void Reverse(int start, int count) Reverst part of the list so the items are in the opposite sequence order.
Throws System.ArgumentException if the count is negative.
Throws System.ArgumentOutOfRangeException if the part does not fit into the list.
start: The index of the start of the part to reverse.
count: The size of the part to reverse.
bool IsSorted(IComparer<T> c) Check if this list is sorted according to a specific sorting order.
Returns: True if the list is sorted, else false.
c: The comparer defining the sorting order.
void Sort(IComparer<T> c) Sort the items of the list according to a specific sorting order. The sorting is stable.
c: The comparer defining the sorting order.
void Shuffle() Randonmly shuffle the items of this list.
void Shuffle(System.Random rnd) Shuffle the items of this list according to a specific random source.
rnd: The random source.
int IndexOf(T item) Searches for an item in the list going forwrds from the start.
Returns: Index of item from start.
item: Item to search for.
int LastIndexOf(T item) Searches for an item in the list going backwords from the end.
Returns: Index of of item from the end.
item: Item to search for.
T RemoveAt(int i) Remove the item at a specific position of the list.
Throws System.IndexOutOfRangeException if i is negative or >= the size of the collection.
Returns: The removed item.
i: The index of the item to remove.
void RemoveInterval(int start, int count) Remove all items in an index interval.
Throws System.IndexOutOfRangeException???.
start: The index of the first item to remove.
count: The number of items to remove.
IDirectedCollectionValue<T> Backwards() Create a collection containing the same items as this collection, but whose enumerator will enumerate the items backwards. The new collection will become invalid if the original is modified. Method typicaly used as in foreach (T x in coll.Backwards()) {...}
Returns: The backwards collection.
bool Contains(T item) Check if this collection contains (an item equivalent to according to the itemhasher) a particular value.
Returns: True if the items is in this collection.
item: The value to check for.
bool Find(ref T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, return in the ref argument (a binary copy of) the actual value found.
Returns: True if the items is in this collection.
item: The value to look for.
bool Update(T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, update the item in the collection to with a binary copy of the supplied value. Will update a single item.
Returns: True if the item was found and hence updated.
item: Value to update.
bool FindOrAdd(ref T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, return in the ref argument (a binary copy of) the actual value found. Else, add the item to the collection.
Returns: True if the item was found (hence not added).
item: The value to look for.
bool UpdateOrAdd(T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, update the item in the collection to with a binary copy of the supplied value; else add the value to the collection.
Returns: True if the item was updated (hence not added).
item: Value to add or update.
bool Remove(T item) Remove a particular item from this collection. Since the collection has bag semantics only one copy equivalent to the supplied item is removed.
Returns: True if the item was found (and removed).
item: The value to remove.
bool RemoveWithReturn(ref T item) Remove a particular item from this collection if found (only one copy). If an item was removed, report a binary copy of the actual item removed in the argument.
Returns: True if the item was found (and removed).
item: The value to remove on input.
void RemoveAll(System.Collections.Generic.IEnumerable<T> items) Remove all items in another collection from this one, take multiplicities into account.
items: The items to remove.
void Clear() Remove all items from this collection.
void RetainAll(System.Collections.Generic.IEnumerable<T> items) Remove all items not in some other collection from this one, take multiplicities into account.
items: The items to retain.
bool ContainsAll(System.Collections.Generic.IEnumerable<T> items) Check if this collection contains all the values in another collection with respect to multiplicities.
Returns: True if all values in itemsis in this collection.
items: The
IList<T> FindAll(Filter<T> filter) Create a new list consisting of the items of this list satisfying a certain predicate.
Returns: The new list.
filter: The filter delegate defining the predicate.
int ContainsCount(T item) Count the number of items of the collection equal to a particular value. Returns 0 if and only if the value is not in the collection.
Returns: The number of copies found.
item: The value to count.
void RemoveAllCopies(T item) Remove all items equivalent to a given value.
item: The value to remove.
System.Collections.Generic.IEnumerator<T> GetEnumerator() Create an enumerator for the collection
Returns: The enumerator
bool Add(T item) Add an item to this collection if possible.
Returns: True.
item: The item to add.
void AddAll(System.Collections.Generic.IEnumerable<T> items) Add the elements from another collection to this collection.
items: The items to add.
void Push(T item) Push an item to the top of the stack.
item: The item
T Pop() Pop the item at the top of the stack from the stack.
Returns: The popped item.
void EnQueue(T item) Enqueue an item at the back of the queue.
item: The item
T DeQueue() Dequeue an item from the front of the queue.
Returns: The item
bool Check() Check the sanity of this list
Returns: true if sane
NPint sequencedhashcode() Inherited from SequencedBase{T}: int sequencedhashcode()
NPbool sequencedequals(ISequenced<T> that) Inherited from SequencedBase{T}: bool sequencedequals(ISequenced<T> that)
NPvoid checkRange(int start, int count) Inherited from CollectionBase{T}: void checkRange(int start, int count)
NPint unsequencedhashcode() Inherited from CollectionBase{T}: int unsequencedhashcode()
NPbool unsequencedequals(ICollection<T> that) Inherited from CollectionBase{T}: bool unsequencedequals(ICollection<T> that)
void CopyTo(T[] a, int i) Inherited from CollectionValueBase{T}: void CopyTo(T[] a, int i)
T[] ToArray() Inherited from CollectionValueBase{T}: T[] ToArray()
void Apply(Applier<T> a) Inherited from CollectionValueBase{T}: void Apply(Applier<T> a)
bool Exists(Filter<T> filter) Inherited from CollectionValueBase{T}: bool Exists(Filter<T> filter)
bool All(Filter<T> filter) Inherited from CollectionValueBase{T}: bool All(Filter<T> filter)
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class HashBag<T>

A bag collection based on a hash table of (item,count) pairs.

Implements

System.Collections.Generic.IEnumerable<T>, ICollection<T>, ICollectionValue<T>, IExtensible<T>

Bases

object, EnumerableBase<T>, CollectionValueBase<T>, CollectionBase<T>

Field overview

bool isReadOnly, IHasher<T> itemhasher, int size, int stamp

Property overview

bool AllowsDuplicates, Speed ContainsSpeed, int Count, Speed CountSpeed, bool IsEmpty, bool IsReadOnly, object SyncRoot

Constructor overview

HashBag<T>(), HashBag<T>(IHasher<T> h)

Method overview

bool Add(T item), void AddAll<U>(System.Collections.Generic.IEnumerable<U> items), void AddAll(System.Collections.Generic.IEnumerable<T> items), bool All(Filter<T> filter), void Apply(Applier<T> a), bool Check(), void checkRange(int start, int count), void Clear(), bool Contains(T item), bool ContainsAll(System.Collections.Generic.IEnumerable<T> items), int ContainsCount(T item), void CopyTo(T[] a, int i), bool Equals(object obj), bool Exists(Filter<T> filter), void Finalize(), bool Find(ref T item), bool FindOrAdd(ref T item), System.Collections.Generic.IEnumerator<T> GetEnumerator(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), void modifycheck(int thestamp), bool Remove(T item), void RemoveAll(System.Collections.Generic.IEnumerable<T> items), void RemoveAllCopies(T item), bool RemoveWithReturn(ref T item), void RetainAll(System.Collections.Generic.IEnumerable<T> items), T[] ToArray(), string ToString(), bool unsequencedequals(ICollection<T> that), int unsequencedhashcode(), bool Update(T item), void updatecheck(), bool UpdateOrAdd(T item)

Field details

Pbool isReadOnly Inherited from CollectionBase{T}: bool isReadOnly
Pint stamp Inherited from CollectionBase{T}: int stamp
Pint size Inherited from CollectionBase{T}: int size
PIHasher<T> itemhasher Inherited from CollectionBase{T}: IHasher<T> itemhasher

Property details

Speed ContainsSpeed Value: Always returns Speed.ConstantThe complexity of the Contains operation
bool AllowsDuplicates Value: Always trueReport if this is a set collection.
bool IsReadOnly Inherited from CollectionBase{T}: bool IsReadOnly
int Count Inherited from CollectionBase{T}: int Count
Speed CountSpeed Inherited from CollectionBase{T}: Speed CountSpeed
object SyncRoot Inherited from CollectionBase{T}: object SyncRoot
bool IsEmpty Inherited from CollectionBase{T}: bool IsEmpty

Constructor details

HashBag<T>() Create a hash bag with the deafult item hasher.
HashBag<T>(IHasher<T> h) Create a hash bag with an external item hasher.
h: The external hasher.

Method details

void AddAll<U>(System.Collections.Generic.IEnumerable<U> items) Add the elements from another collection with a more specialized item type to this collection.
items: The items to add
bool Contains(T item) Check if an item is in the bag
Returns: True if bag contains item
item: The item to look for
bool Find(ref T item) Check if an item (collection equal to a given one) is in the bag and if so report the actual item object found.
Returns: True if bag contains item
item: On entry, the item to look for. On exit the item found, if any
bool Update(T item) Check if an item (collection equal to a given one) is in the bag and if so replace the item object in the bag with the supplied one.
Returns: True if item was found (and updated)
item: The item object to update with
bool FindOrAdd(ref T item) Check if an item (collection equal to a given one) is in the bag. If found, report the actual item object in the bag, else add the supplied one.
Returns: True if item was found
item: On entry, the item to look for or add. On exit the actual object found, if any.
bool UpdateOrAdd(T item) Check if an item (collection equal to a supplied one) is in the bag and if so replace the item object in the set with the supplied one; else add the supplied one.
Returns: True if item was updated
item: The item to look for and update or add
bool Remove(T item) Remove one copy af an item from the bag
Returns: True if item was (found and) removed
item: The item to remove
bool RemoveWithReturn(ref T item) Remove one copy of an item from the bag, reporting the actual matching item object.
Returns: True if item was found.
item: On entry the item to remove. On exit, the actual removed item object.
void RemoveAll(System.Collections.Generic.IEnumerable<T> items) Remove all items in a supplied collection from this bag, counting multiplicities.
items: The items to remove.
void Clear() Remove all items from the bag, resetting internal table to initial size.
void RetainAll(System.Collections.Generic.IEnumerable<T> items) Remove all items *not* in a supplied collection from this bag, counting multiplicities.
items: The items to retain
bool ContainsAll(System.Collections.Generic.IEnumerable<T> items) Check if all items in a supplied collection is in this bag (counting multiplicities).
Returns: True if all items are found.
items: The items to look for.
T[] ToArray() Create an array containing all items in this bag (in enumeration order).
Returns: The array
int ContainsCount(T item) Count the number of times an item is in this set.
Returns: The count
item: The item to look for.
void RemoveAllCopies(T item) Remove all copies of item from this set.
item: The item to remove
void CopyTo(T[] a, int i) Copy the items of this bag to part of an array.
Throws System.ArgumentOutOfRangeException if i is negative.
Throws System.ArgumentException if the array does not have room for the items.
a: The array to copy to
i: The starting index.
bool Add(T item) Add an item to this bag.
Returns: Always true
item: The item to add.
void AddAll(System.Collections.Generic.IEnumerable<T> items) Add all items of a collection to this set.
items: The items to add
System.Collections.Generic.IEnumerator<T> GetEnumerator() Create an enumerator for this bag.
Returns: The enumerator
bool Check() Test internal structure of data (invariants)
Returns: True if pass
NPvoid checkRange(int start, int count) Inherited from CollectionBase{T}: void checkRange(int start, int count)
NPint unsequencedhashcode() Inherited from CollectionBase{T}: int unsequencedhashcode()
NPbool unsequencedequals(ICollection<T> that) Inherited from CollectionBase{T}: bool unsequencedequals(ICollection<T> that)
Pvoid modifycheck(int thestamp) Inherited from CollectionBase{T}: void modifycheck(int thestamp)
Pvoid updatecheck() Inherited from CollectionBase{T}: void updatecheck()
void Apply(Applier<T> a) Inherited from CollectionValueBase{T}: void Apply(Applier<T> a)
bool Exists(Filter<T> filter) Inherited from CollectionValueBase{T}: bool Exists(Filter<T> filter)
bool All(Filter<T> filter) Inherited from CollectionValueBase{T}: bool All(Filter<T> filter)
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class TreeBag<T>

An implementation of Red-Black trees as an indexed, sorted collection with bag semantics, cf. CLRS. (See for an implementation with set semantics).
The comparer (sorting order) may be either natural, because the item type is comparable (generic: See or non-generic: System.IComparable) or it can be external and supplied by the user in the constructor.
Each distinct item is only kept in one place in the tree - together with the number of times it is a member of the bag. Thus, if two items that are equal according

Implements

System.Collections.Generic.IEnumerable<T>, System.IDisposable, ICollection<T>, ICollectionValue<T>, IDirectedCollectionValue<T>, IDirectedEnumerable<T>, IExtensible<T>, IIndexed<T>, IIndexedSorted<T>, IPersistentSorted<T>, IPriorityQueue<T>, ISequenced<T>, ISorted<T>

Bases

object, EnumerableBase<T>, CollectionValueBase<T>, CollectionBase<T>, SequencedBase<T>

Field overview

bool isReadOnly, IHasher<T> itemhasher, int size, int stamp

Property overview

bool AllowsDuplicates, IComparer<T> Comparer, Speed ContainsSpeed, int Count, Speed CountSpeed, EnumerationDirection Direction, TreeBag<T>.Feature Features, bool IsEmpty, bool IsReadOnly, T this[int i], IDirectedCollectionValue<T> this[int start, int end], object SyncRoot

Constructor overview

TreeBag<T>(), TreeBag<T>(IComparer<T> c), TreeBag<T>(IComparer<T> c, IHasher<T> h)

Method overview

bool Add(T item), void AddAll<U>(System.Collections.Generic.IEnumerable<U> items), void AddAll(System.Collections.Generic.IEnumerable<T> items), void AddSorted(System.Collections.Generic.IEnumerable<T> items), bool All(Filter<T> filter), void Apply(Applier<T> a), IDirectedCollectionValue<T> Backwards(), bool Check(string name), bool Check(), void checkRange(int start, int count), void Clear(), bool Contains(T item), bool ContainsAll(System.Collections.Generic.IEnumerable<T> items), int ContainsCount(T item), void CopyTo(T[] a, int i), int CountFrom(T bot), int CountFromTo(T bot, T top), int CountTo(T top), bool Cut(System.IComparable<T> c, out T low, out bool lowIsValid, out T high, out bool highIsValid), T DeleteMax(), T DeleteMin(), void Dispose(), void dump(), void dump(string msg), bool Equals(object obj), bool Exists(Filter<T> filter), void Finalize(), bool Find(ref T item), IIndexedSorted<T> FindAll(Filter<T> filter), T FindMax(), T FindMin(), bool FindOrAdd(ref T item), System.Collections.Generic.IEnumerator<T> GetEnumerator(), int GetHashCode(), System.Type GetType(), int IndexOf(T item), int LastIndexOf(T item), IIndexedSorted<V> Map<V>(Mapper<T,V> mapper, IComparer<V> c), object MemberwiseClone(), void modifycheck(int thestamp), T Predecessor(T item), IDirectedCollectionValue<T> RangeAll(), IDirectedCollectionValue<T> RangeFrom(T bot), IDirectedCollectionValue<T> RangeFromTo(T bot, T top), IDirectedCollectionValue<T> RangeTo(T top), bool Remove(T item), void RemoveAll(System.Collections.Generic.IEnumerable<T> items), void RemoveAllCopies(T item), T RemoveAt(int i), void RemoveInterval(int start, int count), void RemoveRangeFrom(T low), void RemoveRangeFromTo(T low, T hi), void RemoveRangeTo(T hi), bool RemoveWithReturn(ref T item), void RetainAll(System.Collections.Generic.IEnumerable<T> items), bool sequencedequals(ISequenced<T> that), int sequencedhashcode(), ISorted<T> Snapshot(), T Successor(T item), T[] ToArray(), string ToString(), bool unsequencedequals(ICollection<T> that), int unsequencedhashcode(), bool Update(T item), void updatecheck(), bool UpdateOrAdd(T item), T WeakPredecessor(T item), T WeakSuccessor(T item)

Field details

Pbool isReadOnly Inherited from CollectionBase{T}: bool isReadOnly
Pint stamp Inherited from CollectionBase{T}: int stamp
Pint size Inherited from CollectionBase{T}: int size
PIHasher<T> itemhasher Inherited from CollectionBase{T}: IHasher<T> itemhasher

Property details

TreeBag<T>.Feature Features A debugging aid for making the selected compilation alternatives available to the user. (To be removed when selection is finally fixed for production version).
bool AllowsDuplicates Value: True since this collection has bag semantics.
Speed ContainsSpeed Value: Speed.LogThe value is symbolic indicating the type of asymptotic complexity in terms of the size of this collection (worst-case or amortized as relevant).
T this[int i] Value: The i'th item of this list.
Throws System.IndexOutOfRangeException if i is negative or >= the size of the collection.
i: the index to lookup
IDirectedCollectionValue<T> this[int start, int end] Value: The directed collection of items in a specific index interval.
Throws System.IndexOutOfRangeException.
start: The low index of the interval (inclusive).
end: The high index of the interval (exclusive).
IComparer<T> Comparer Value: The comparerThe comparer object supplied at creation time for this collection
EnumerationDirection Direction Inherited from SequencedBase{T}: EnumerationDirection Direction
bool IsReadOnly Inherited from CollectionBase{T}: bool IsReadOnly
int Count Inherited from CollectionBase{T}: int Count
Speed CountSpeed Inherited from CollectionBase{T}: Speed CountSpeed
object SyncRoot Inherited from CollectionBase{T}: object SyncRoot
bool IsEmpty Inherited from CollectionBase{T}: bool IsEmpty

Constructor details

TreeBag<T>() Create a red-black tree collection with natural comparer and item hasher.
TreeBag<T>(IComparer<T> c) Create a red-black tree collection with an external comparer (and natural item hasher, assumed consistent).
c: The external comparer
TreeBag<T>(IComparer<T> c, IHasher<T> h) Create a red-black tree collection with an external comparer aand an external item hasher, assumed consistent.
c: The external comparer
h: The external item hasher

Method details

void AddAll<U>(System.Collections.Generic.IEnumerable<U> items) Add the elements from another collection with a more specialized item type to this collection. If this collection has set semantics, only items not already in the collection will be added.
items: The items to add
IIndexedSorted<V> Map<V>(Mapper<T,V> mapper, IComparer<V> c) Create a new indexed sorted collection consisting of the results of mapping all items of this list.
Throws System.ArgumentException if the map is not increasing over the items of this collection (with respect to the two given comparison relations).
Returns: The new sorted collection.
mapper: The delegate definging the map.
c: The comparion relation to use for the result.
System.Collections.Generic.IEnumerator<T> GetEnumerator() Create an enumerator for this tree
Returns: The enumerator
bool Add(T item) Add an item to this collection if possible. If this collection has set semantics, the item will be added if not already in the collection. If bag semantics, the item will always be added.
Returns: True if item was added.
item: The item to add.
void AddAll(System.Collections.Generic.IEnumerable<T> items) Add the elements from another collection to this collection. If this collection has set semantics, only items not already in the collection will be added.
items: The items to add.
void AddSorted(System.Collections.Generic.IEnumerable<T> items) Add all the items from another collection with an enumeration order that is increasing in the items. The idea is that the implementation may use a faster algorithm to merge the two collections.
Throws System.ArgumentException if the enumerated items turns out not to be in increasing order.
items: The collection to add.
bool Contains(T item) Check if this collection contains (an item equivalent to according to the itemhasher) a particular value.
Returns: True if the items is in this collection.
item: The value to check for.
bool Find(ref T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, return in the ref argument (a binary copy of) the actual value found.
Returns: True if the items is in this collection.
item: The value to look for.
bool FindOrAdd(ref T item) Find or add the item to the tree. If the tree does not contain an item equivalent to this item add it, else return the exisiting one in the ref argument.
Returns: True if item was found
item:
bool Update(T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, update the item in the collection to with a binary copy of the supplied value. If the collection has bag semantics, this updates all equivalent copies in the collection.
Returns: True if the item was found and hence updated.
item: Value to update.
bool UpdateOrAdd(T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, update the item in the collection to with a binary copy of the supplied value; else add the value to the collection.

NOTE: the bag implementation is currently wrong!

Returns: True if the item was found and updated (hence not added).
item: Value to add or update.
bool Remove(T item) Remove a particular item from this collection. If the collection has bag semantics only one copy equivalent to the supplied item is removed.
Returns: True if the item was found (and removed).
item: The value to remove.
bool RemoveWithReturn(ref T item) Remove a particular item from this collection if found. If the collection has bag semantics only one copy equivalent to the supplied item is removed, which one is implementation dependent. If an item was removed, report a binary copy of the actual item removed in the argument.
Returns: True if the item was found (and removed).
item: The value to remove on input.
void Clear() Remove all items from this collection.
void RemoveAll(System.Collections.Generic.IEnumerable<T> items) Remove all items in another collection from this one. If this collection has bag semantics, take multiplicities into account.
items: The items to remove.
void RetainAll(System.Collections.Generic.IEnumerable<T> items) Remove all items not in some other collection from this one. If this collection has bag semantics, take multiplicities into account.
items: The items to retain.
bool ContainsAll(System.Collections.Generic.IEnumerable<T> items) Check if this collection contains all the values in another collection. If this collection has bag semantics (NoDuplicates==false) the check is made with respect to multiplicities, else multiplicities are not taken into account.
Returns: True if all values in itemsis in this collection.
items: The
IIndexedSorted<T> FindAll(Filter<T> filter) Create a new indexed sorted collection consisting of the items of this indexed sorted collection satisfying a certain predicate.
Returns: The new indexed sorted collection.
filter: The filter delegate defining the predicate.
int ContainsCount(T item) Count the number of items of the collection equal to a particular value. Returns 0 if and only if the value is not in the collection.
Returns: The number of copies found.
item: The value to count.
void RemoveAllCopies(T item) Remove all items equivalent to a given value.
item: The value to remove.
int IndexOf(T item) Searches for an item in the list going forwrds from the start.
Returns: Index of item from start.
item: Item to search for.
int LastIndexOf(T item) Searches for an item in the list going backwords from the end.
Returns: Index of of item from the end.
item: Item to search for.
T RemoveAt(int i) Remove the item at a specific position of the list.
Throws System.IndexOutOfRangeException if i is negative or >= the size of the collection.
Returns: The removed item.
i: The index of the item to remove.
void RemoveInterval(int start, int count) Remove all items in an index interval.
Throws System.IndexOutOfRangeException???.
start: The index of the first item to remove.
count: The number of items to remove.
IDirectedCollectionValue<T> Backwards() Create a collection containing the same items as this collection, but whose enumerator will enumerate the items backwards. The new collection will become invalid if the original is modified. Method typicaly used as in foreach (T x in coll.Backwards()) {...}
Returns: The backwards collection.
T FindMin() Find the current least item of this priority queue.
Returns: The least item.
T DeleteMin() Remove the least item from this priority queue.
Returns: The removed item.
T FindMax() Find the current largest item of this priority queue.
Returns: The largest item.
T DeleteMax() Remove the largest item from this priority queue.
Returns: The removed item.
T Predecessor(T item) Find the strict predecessor in the sorted collection of a particular value, i.e. the largest item in the collection less than the supplied value.
Throws System.InvalidOperationException if no such element exists (the supplied value is less than or equal to the minimum of this collection.)
Returns: The predecessor.
item: The item to find the predecessor for.
T WeakPredecessor(T item) Find the weak predecessor in the sorted collection of a particular value, i.e. the largest item in the collection less than or equal to the supplied value.
Throws System.InvalidOperationException if no such element exists (the supplied value is less than the minimum of this collection.)
Returns: The weak predecessor.
item: The item to find the weak predecessor for.
T Successor(T item) Find the strict successor in the sorted collection of a particular value, i.e. the least item in the collection greater than the supplied value.
Throws System.InvalidOperationException if no such element exists (the supplied value is greater than or equal to the maximum of this collection.)
Returns: The successor.
item: The item to find the successor for.
T WeakSuccessor(T item) Find the weak successor in the sorted collection of a particular value, i.e. the least item in the collection greater than or equal to the supplied value.
Throws System.InvalidOperationException if no such element exists (the supplied value is greater than the maximum of this collection.)
Returns: The weak successor.
item: The item to find the weak successor for.
IDirectedCollectionValue<T> RangeFrom(T bot) Query this sorted collection for items greater than or equal to a supplied value.
Returns: The result directed collection.
bot: The lower bound (inclusive).
IDirectedCollectionValue<T> RangeFromTo(T bot, T top) Query this sorted collection for items between two supplied values.
Returns: The result directed collection.
bot: The lower bound (inclusive).
top: The upper bound (exclusive).
IDirectedCollectionValue<T> RangeTo(T top) Query this sorted collection for items less than a supplied value.
Returns: The result directed collection.
top: The upper bound (exclusive).
IDirectedCollectionValue<T> RangeAll() Create a directed collection with the same items as this collection.
Returns: The result directed collection.
bool Cut(System.IComparable<T> c, out T low, out bool lowIsValid, out T high, out bool highIsValid) Perform a search in the sorted collection for the ranges in which a non-decreasing function from the item type to int is negative, zero respectively positive. If the supplied cut function is not non-decreasing, the result of this call is undefined.
Returns:
c: The cut function T to int, given as an IComparable<T> object, where the cut function is the c.CompareTo(T that) method.
low: Returns the largest item in the collection, where the cut function is negative (if any).
lowIsValid: True if the cut function is negative somewhere on this collection.
high: Returns the least item in the collection, where the cut function is positive (if any).
highIsValid: True if the cut function is positive somewhere on this collection.
int CountFrom(T bot) Determine the number of items at or above a supplied threshold.
Returns: The number of matcing items.
bot: The lower bound (inclusive)
int CountFromTo(T bot, T top) Determine the number of items between two supplied thresholds.
Returns: The number of matcing items.
bot: The lower bound (inclusive)
top: The upper bound (exclusive)
int CountTo(T top) Determine the number of items below a supplied threshold.
Returns: The number of matcing items.
top: The upper bound (exclusive)
void RemoveRangeFrom(T low) Remove all items of this collection above or at a supplied threshold.
low: The lower threshold (inclusive).
void RemoveRangeFromTo(T low, T hi) Remove all items of this collection between two supplied thresholds.
low: The lower threshold (inclusive).
hi: The upper threshold (exclusive).
void RemoveRangeTo(T hi) Remove all items of this collection below a supplied threshold.
hi: The upper threshold (exclusive).
void Dispose() If this tree is a snapshot, remove registration in base tree
Pvoid Finalize() If this tree is a snapshot, remove registration in base tree
ISorted<T> Snapshot() Make a (read-only) snap shot of this collection.
Returns: The snap shot.
Nvoid dump() Print the tree structure to the console stdout.
Nvoid dump(string msg) Print the tree structure to the console stdout.
msg:
Nbool Check(string name) Checks red-black invariant. Dumps tree to console if bad
Returns: false if invariant violation
name: Title of dump
bool Check() Checks red-black invariant. Dumps tree to console if bad
Returns: false if invariant violation
NPint sequencedhashcode() Inherited from SequencedBase{T}: int sequencedhashcode()
NPbool sequencedequals(ISequenced<T> that) Inherited from SequencedBase{T}: bool sequencedequals(ISequenced<T> that)
NPvoid checkRange(int start, int count) Inherited from CollectionBase{T}: void checkRange(int start, int count)
NPint unsequencedhashcode() Inherited from CollectionBase{T}: int unsequencedhashcode()
NPbool unsequencedequals(ICollection<T> that) Inherited from CollectionBase{T}: bool unsequencedequals(ICollection<T> that)
Pvoid modifycheck(int thestamp) Inherited from CollectionBase{T}: void modifycheck(int thestamp)
Pvoid updatecheck() Inherited from CollectionBase{T}: void updatecheck()
void CopyTo(T[] a, int i) Inherited from CollectionValueBase{T}: void CopyTo(T[] a, int i)
T[] ToArray() Inherited from CollectionValueBase{T}: T[] ToArray()
void Apply(Applier<T> a) Inherited from CollectionValueBase{T}: void Apply(Applier<T> a)
bool Exists(Filter<T> filter) Inherited from CollectionValueBase{T}: bool Exists(Filter<T> filter)
bool All(Filter<T> filter) Inherited from CollectionValueBase{T}: bool All(Filter<T> filter)
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()

Class TreeBag<T>.Enumerator

An enumerator for a red-black tree collection. Based on an explicit stack of subtrees waiting to be enumerated. Currently only used for the tree set enumerators (tree bag enumerators use an iterator block based enumerator).

Implements

System.Collections.Generic.IEnumerator<T>, System.IDisposable

Bases

object

Property overview

T Current

Constructor overview

TreeBag<T>.Enumerator(TreeBag<T> tree)

Method overview

void Dispose(), void Dispose(bool disposing), bool Equals(object obj), void Finalize(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), bool MoveNext(), string ToString()

Property details

T Current Value: The current item of the enumerator.Undefined if enumerator is not valid (MoveNext hash been called returning true)

Constructor details

TreeBag<T>.Enumerator(TreeBag<T> tree) Create a tree enumerator
tree: The red-black tree to enumerate

Method details

bool MoveNext() Move enumerator to next item in tree, or the first item if this is the first call to MoveNext.
Throws System.InvalidOperationException if underlying tree was modified.
Returns: True if enumerator is valid now
void Dispose() Call Dispose(true) and then suppress finalization of this enumerator.
Pvoid Dispose(bool disposing) Remove the internal data (notably the stack array).
disposing: True if called from Dispose(), false if called from the finalizer
Pvoid Finalize() Finalizer for enumeratir
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()

Class TreeBag<T>.SnapEnumerator

An enumerator for a snapshot of a node copy persistent red-black tree collection.

Implements

System.Collections.Generic.IEnumerator<T>, System.IDisposable

Bases

object

Property overview

T Current

Constructor overview

TreeBag<T>.SnapEnumerator(TreeBag<T> tree)

Method overview

bool Equals(object obj), void Finalize(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), bool MoveNext(), string ToString()

Property details

T Current Value: The current value of the enumerator.Undefined if enumerator is not valid (MoveNext hash been called returning true)

Constructor details

TreeBag<T>.SnapEnumerator(TreeBag<T> tree) Creta an enumerator for a snapshot of a node copy persistent red-black tree collection
tree: The snapshot

Method details

bool MoveNext() Move enumerator to next item in tree, or the first item if this is the first call to MoveNext.
Throws System.InvalidOperationException if underlying tree was modified.
Returns: True if enumerator is valid now
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class TreeBag<T>.Range.Enumerator

Implements

System.Collections.Generic.IEnumerator<T>, System.IDisposable

Bases

object

Property overview

T Current

Constructor overview

TreeBag<T>.Range.Enumerator(TreeBag<T>.Range range)

Method overview

void Dispose(), bool Equals(object obj), void Finalize(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), bool MoveNext(), string ToString()

Property details

T Current Value: The current value of the enumerator.Undefined if enumerator is not valid (MoveNext hash been called returning true)

Constructor details

TreeBag<T>.Range.Enumerator(TreeBag<T>.Range range)
range:

Method details

bool MoveNext() Move enumerator to next item in tree, or the first item if this is the first call to MoveNext.
Throws System.InvalidOperationException if underlying tree was modified.
Returns: True if enumerator is valid now
void Dispose()
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class DictionaryBase<K,V>

A base class for implementing a dictionary based on a set collection implementation.

See the source code for See for an example

Implements

System.Collections.Generic.IEnumerable<KeyValuePair<K,V>>, IDictionary<K,V>

Bases

object, EnumerableBase<KeyValuePair<K,V>>

Base of

HashDictionary<K,V>, TreeDictionary<K,V>

Field overview

ICollection<KeyValuePair<K,V>> pairs

Property overview

int Count, bool IsReadOnly, V this[K key], ICollectionValue<K> Keys, object SyncRoot, ICollectionValue<V> Values

Constructor overview

DictionaryBase<K,V>()

Method overview

void Add(K key, V val), bool Check(), void Clear(), bool Contains(K key), bool Equals(object obj), void Finalize(), bool Find(K key, out V val), bool FindOrAdd(K key, ref V val), System.Collections.Generic.IEnumerator<KeyValuePair<K,V>> GetEnumerator(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), bool Remove(K key), bool Remove(K key, out V val), string ToString(), bool Update(K key, V val), bool UpdateOrAdd(K key, V val)

Field details

PICollection<KeyValuePair<K,V>> pairs The set collection of entries underlying this dictionary implementation

Property details

int Count Value: The number of entrues in the dictionary
object SyncRoot Value: A distinguished object to use for locking to synchronize multithreaded access
ICollectionValue<K> Keys Value: A collection containg the all the keys of the dictionary
ICollectionValue<V> Values Value: A collection containing all the values of the dictionary
V this[K key] Value: The value corresponding to the keyIndexer for dictionary.
Throws System.InvalidOperationException if no entry is found.
key:
bool IsReadOnly Value: True if dictionary is read only

Constructor details

PDictionaryBase<K,V>()

Method details

void Add(K key, V val) Add a new (key, value) pair (a mapping) to the dictionary.
Throws System.InvalidOperationException if there already is an entry with the same key.
key: Key to add
val: Value to add
bool Remove(K key) Remove an entry with a given key from the dictionary
Returns: True if an entry was found (and removed)
key: The key of the entry to remove
bool Remove(K key, out V val) Remove an entry with a given key from the dictionary and report its value.
Returns: True if an entry was found (and removed)
key: The key of the entry to remove
val: On exit, the value of the removed entry
void Clear() Remove all entries from the dictionary
bool Contains(K key) Check if there is an entry with a specified key
Returns: True if key was found
key: The key to look for
bool Find(K key, out V val) Check if there is an entry with a specified key and report the corresponding value if found. This can be seen as a safe form of "val = this[key]".
Returns: True if key was found
key: The key to look for
val: On exit, the value of the entry
bool Update(K key, V val) Look for a specific key in the dictionary and if found replace the value with a new one. This can be seen as a non-adding version of "this[key] = val".
Returns: True if key was found
key: The key to look for
val: The new value
bool FindOrAdd(K key, ref V val) Look for a specific key in the dictionary. If found, report the corresponding value, else add an entry with the key and the supplied value.
Returns: True if key was found
key: The key to look for
val: On entry the value to add if the key is not found. On exit the value found if any.
bool UpdateOrAdd(K key, V val) Update value in dictionary corresponding to key if found, else add new entry. More general than "this[key] = val;" by reporting if key was found.
Returns: True if entry was updated.
key: The key to look for
val: The value to add or replace with.
bool Check() Check the integrity of the internal data structures of this dictionary. Only avaliable in DEBUG builds???
Returns: True if check does not fail.
System.Collections.Generic.IEnumerator<KeyValuePair<K,V>> GetEnumerator() Create an enumerator for the collection of entries of the dictionary
Returns: The enumerator
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class TreeDictionary<K,V>

A sorted generic dictionary based on a red-black tree set.

Implements

System.Collections.Generic.IEnumerable<KeyValuePair<K,V>>, IDictionary<K,V>, ISortedDictionary<K,V>

Bases

object, EnumerableBase<KeyValuePair<K,V>>, DictionaryBase<K,V>

Field overview

ICollection<KeyValuePair<K,V>> pairs

Property overview

int Count, bool IsReadOnly, V this[K key], ICollectionValue<K> Keys, object SyncRoot, ICollectionValue<V> Values

Constructor overview

TreeDictionary<K,V>(), TreeDictionary<K,V>(IComparer<K> c)

Method overview

void Add(K key, V val), bool Check(), void Clear(), bool Contains(K key), bool Equals(object obj), void Finalize(), bool Find(K key, out V val), bool FindOrAdd(K key, ref V val), System.Collections.Generic.IEnumerator<KeyValuePair<K,V>> GetEnumerator(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), KeyValuePair<K,V> Predecessor(K key), bool Remove(K key), bool Remove(K key, out V val), System.Collections.Generic.IEnumerable<KeyValuePair<K,V>> Snapshot(), KeyValuePair<K,V> Successor(K key), string ToString(), bool Update(K key, V val), bool UpdateOrAdd(K key, V val), KeyValuePair<K,V> WeakPredecessor(K key), KeyValuePair<K,V> WeakSuccessor(K key)

Field details

PICollection<KeyValuePair<K,V>> pairs Inherited from DictionaryBase{K,V}: ICollection<KeyValuePair<K,V>> pairs

Property details

int Count Inherited from DictionaryBase{K,V}: int Count
object SyncRoot Inherited from DictionaryBase{K,V}: object SyncRoot
ICollectionValue<K> Keys Inherited from DictionaryBase{K,V}: ICollectionValue<K> Keys
ICollectionValue<V> Values Inherited from DictionaryBase{K,V}: ICollectionValue<V> Values
V this[K key] Inherited from DictionaryBase{K,V}: V this[K key]
bool IsReadOnly Inherited from DictionaryBase{K,V}: bool IsReadOnly

Constructor details

TreeDictionary<K,V>() Create a red-black tree dictionary using the natural comparer for keys.
Throws System.ArgumentException if the key type K is not comparable.
TreeDictionary<K,V>(IComparer<K> c) Create a red-black tree dictionary using an external comparer for keys.
c: The external comparer

Method details

KeyValuePair<K,V> Predecessor(K key) Get the entry in the dictionary whose key is the predecessor of a specified key.
Returns: The entry
key: The key
KeyValuePair<K,V> WeakPredecessor(K key) Get the entry in the dictionary whose key is the weak predecessor of a specified key.
Returns: The entry
key: The key
KeyValuePair<K,V> Successor(K key) Get the entry in the dictionary whose key is the successor of a specified key.
Returns: The entry
key: The key
KeyValuePair<K,V> WeakSuccessor(K key) Get the entry in the dictionary whose key is the weak successor of a specified key.
Returns: The entry
key: The key
NSystem.Collections.Generic.IEnumerable<KeyValuePair<K,V>> Snapshot() Make a snapshot of the current state of this dictionary
Returns: The snapshot
void Add(K key, V val) Inherited from DictionaryBase{K,V}: void Add(K key, V val)
bool Remove(K key) Inherited from DictionaryBase{K,V}: bool Remove(K key)
bool Remove(K key, out V val) Inherited from DictionaryBase{K,V}: bool Remove(K key, out V val)
void Clear() Inherited from DictionaryBase{K,V}: void Clear()
bool Contains(K key) Inherited from DictionaryBase{K,V}: bool Contains(K key)
bool Find(K key, out V val) Inherited from DictionaryBase{K,V}: bool Find(K key, out V val)
bool Update(K key, V val) Inherited from DictionaryBase{K,V}: bool Update(K key, V val)
bool FindOrAdd(K key, ref V val) Inherited from DictionaryBase{K,V}: bool FindOrAdd(K key, ref V val)
bool UpdateOrAdd(K key, V val) Inherited from DictionaryBase{K,V}: bool UpdateOrAdd(K key, V val)
bool Check() Inherited from DictionaryBase{K,V}: bool Check()
System.Collections.Generic.IEnumerator<KeyValuePair<K,V>> GetEnumerator() Inherited from DictionaryBase{K,V}: System.Collections.Generic.IEnumerator<KeyValuePair<K,V>> GetEnumerator()
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class HashedLinkedList<T>

A list collection based on a doubly linked list data structure with a hash index mapping item to node.

Implements

System.Collections.Generic.IEnumerable<T>, ICollection<T>, ICollectionValue<T>, IDirectedCollectionValue<T>, IDirectedEnumerable<T>, IExtensible<T>, IIndexed<T>, IList<T>, IQueue<T>, ISequenced<T>, IStack<T>

Bases

object, EnumerableBase<T>, CollectionValueBase<T>, CollectionBase<T>, SequencedBase<T>, LinkedList<T>

Field overview

LinkedList<T>.Node endsentinel, bool isReadOnly, IHasher<T> itemhasher, bool maintaintags, int offset, int size, int stamp, LinkedList<T>.Node startsentinel, LinkedList<T> underlying

Property overview

bool AllowsDuplicates, Speed ContainsSpeed, int Count, Speed CountSpeed, EnumerationDirection Direction, bool FIFO, T First, bool IsEmpty, bool IsReadOnly, T this[int i], IDirectedCollectionValue<T> this[int start, int count], T Last, int Offset, object SyncRoot, IList<T> Underlying

Constructor overview

HashedLinkedList<T>(IHasher<T> itemhasher), HashedLinkedList<T>()

Method overview

bool Add(T item), void AddAll<U>(System.Collections.Generic.IEnumerable<U> items), void AddAll(System.Collections.Generic.IEnumerable<T> items), bool All(Filter<T> filter), void Apply(Applier<T> a), IDirectedCollectionValue<T> Backwards(), bool Check(), void checkRange(int start, int count), void Clear(), bool Contains(T item), bool ContainsAll(System.Collections.Generic.IEnumerable<T> items), int ContainsCount(T item), void CopyTo(T[] a, int i), T DeQueue(), void EnQueue(T item), bool Equals(object obj), bool Exists(Filter<T> filter), void Finalize(), bool Find(ref T item), IList<T> FindAll(Filter<T> filter), bool FindOrAdd(ref T item), LinkedList<T>.Node get(int n), System.Collections.Generic.IEnumerator<T> GetEnumerator(), int GetHashCode(), LinkedList<T>.TagGroup gettaggroup(LinkedList<T>.Node pred, LinkedList<T>.Node succ, out int lowbound, out int highbound), System.Type GetType(), int IndexOf(T item), void Insert(int i, T item), void InsertAfter(T item, T target), void InsertAll(int i, System.Collections.Generic.IEnumerable<T> items), void InsertBefore(T item, T target), void InsertFirst(T item), void InsertLast(T item), void insertNode(LinkedList<T>.Node succ, LinkedList<T>.Node newnode), bool IsSorted(IComparer<T> c), int LastIndexOf(T item), IList<V> Map<V>(Mapper<T,V> mapper), IList<V> Map<V>(Mapper<T,V> mapper, IHasher<V> hasher), object MemberwiseClone(), void modifycheck(), void modifycheck(int stamp), T Pop(), void Push(T item), T remove(LinkedList<T>.Node node), T Remove(), bool Remove(T item), void RemoveAll(System.Collections.Generic.IEnumerable<T> items), void RemoveAllCopies(T item), T RemoveAt(int i), T RemoveFirst(), void removefromtaggroup(LinkedList<T>.Node node), void RemoveInterval(int start, int count), T RemoveLast(), bool RemoveWithReturn(ref T item), void RetainAll(System.Collections.Generic.IEnumerable<T> items), void Reverse(int start, int count), void Reverse(), bool sequencedequals(ISequenced<T> that), int sequencedhashcode(), void settag(LinkedList<T>.Node node), void Shuffle(System.Random rnd), void Shuffle(), void Slide(int offset), void Slide(int offset, int size), void Sort(IComparer<T> c), void splittaggroup(LinkedList<T>.TagGroup taggroup), T[] ToArray(), string ToString(), bool unsequencedequals(ICollection<T> that), int unsequencedhashcode(), bool Update(T item), void updatecheck(), bool UpdateOrAdd(T item), IList<T> View(int start, int count)

Field details

Pbool maintaintags Inherited from LinkedList{T}: bool maintaintags
PLinkedList<T>.Node startsentinel Inherited from LinkedList{T}: LinkedList<T>.Node startsentinel
PLinkedList<T>.Node endsentinel Inherited from LinkedList{T}: LinkedList<T>.Node endsentinel
Pint offset Inherited from LinkedList{T}: int offset
PLinkedList<T> underlying Inherited from LinkedList{T}: LinkedList<T> underlying
Pbool isReadOnly Inherited from CollectionBase{T}: bool isReadOnly
Pint stamp Inherited from CollectionBase{T}: int stamp
Pint size Inherited from CollectionBase{T}: int size
PIHasher<T> itemhasher Inherited from CollectionBase{T}: IHasher<T> itemhasher

Property details

T this[int i] Value: The i'th item of this list.On this list, this indexer is read/write.
Throws System.IndexOutOfRangeException if i is negative or >= the size of the collection.
i: The index of the item to fetch or store.
Speed ContainsSpeed Value: Speed.ConstantThe value is symbolic indicating the type of asymptotic complexity in terms of the size of this collection (worst-case or amortized as relevant).
bool AllowsDuplicates Value: False since this collection has set semantics.
T First Inherited from LinkedList{T}: T First
T Last Inherited from LinkedList{T}: T Last
bool FIFO Inherited from LinkedList{T}: bool FIFO
IList<T> Underlying Inherited from LinkedList{T}: IList<T> Underlying
int Offset Inherited from LinkedList{T}: int Offset
IDirectedCollectionValue<T> this[int start, int count] Inherited from LinkedList{T}: IDirectedCollectionValue<T> this[int start, int count]
int Count Inherited from LinkedList{T}: int Count
EnumerationDirection Direction Inherited from SequencedBase{T}: EnumerationDirection Direction
bool IsReadOnly Inherited from CollectionBase{T}: bool IsReadOnly
Speed CountSpeed Inherited from CollectionBase{T}: Speed CountSpeed
object SyncRoot Inherited from CollectionBase{T}: object SyncRoot
bool IsEmpty Inherited from CollectionBase{T}: bool IsEmpty

Constructor details

HashedLinkedList<T>(IHasher<T> itemhasher) Create a hashed linked list with an external item hasher.
itemhasher: The external hasher
HashedLinkedList<T>() Create a hashed linked list with the natural item hasher.

Method details

void AddAll<U>(System.Collections.Generic.IEnumerable<U> items) Add the elements from another collection with a more specialized item type to this collection. Only items not already in the collection will be added.
items: The items to add
void Insert(int i, T item) Insert an item at a specific index location in this list.
Throws System.IndexOutOfRangeException if i is negative or > the size of the collection.
i: The index at which to insert.
item: The item to insert.
void InsertAll(int i, System.Collections.Generic.IEnumerable<T> items) Insert into this list all items from an enumerable collection starting at a particular index.
Throws System.IndexOutOfRangeException if i is negative or > the size of the collection.
Throws System.InvalidOperationException if one of the items to insert is already in the list.
i: Index to start inserting at
items: Items to insert
void InsertBefore(T item, T target) Insert an item right before the first occurrence of some target item.
Throws System.ArgumentException if target is not found
Throws System.InvalidOperationException if the item is already in the list.
item: The item to insert.
target: The target before which to insert.
void InsertAfter(T item, T target) Insert an item right after the last(???) occurrence of some target item.
Throws System.ArgumentException if target is not found
Throws System.InvalidOperationException if the item is already in the list.
item: The item to insert.
target: The target after which to insert.
void InsertFirst(T item) Insert an item at the front of this list.
Throws System.InvalidOperationException if the item is already in the list.
item: The item to insert.
void InsertLast(T item) Insert an item at the back of this list.
Throws System.InvalidOperationException if the item is already in the list.
item: The item to insert.
T Remove() Remove one item from the list: from the front if FIFO is true, else from the back.
Throws System.InvalidOperationException if this list is empty.
Returns: The removed item.
T RemoveFirst() Remove one item from the front of the list.
Throws System.InvalidOperationException if this list is empty.
Returns: The removed item.
T RemoveLast() Remove one item from the back of the list.
Throws System.InvalidOperationException if this list is empty.
Returns: The removed item.
IList<T> View(int start, int count) Create a list view on this list.
Throws System.ArgumentOutOfRangeException if the view would not fit into this list.
Returns: The new list view.
start: The index in this list of the start of the view.
count: The size of the view.
void Reverse(int start, int count) Reverst part of the list so the items are in the opposite sequence order.
Throws System.ArgumentException if the count is negative.
Throws System.ArgumentOutOfRangeException if the part does not fit into the list.
start: The index of the start of the part to reverse.
count: The size of the part to reverse.
void Shuffle(System.Random rnd) Shuffle the items of this list according to a specific random source.
rnd: The random source.
int IndexOf(T item) Searches for an item in the list going forwrds from the start.
Returns: Index of item from start.
item: Item to search for.
int LastIndexOf(T item) Searches for an item in the list going backwords from the end.
Returns: Index of of item from the end.
item: Item to search for.
T RemoveAt(int i) Remove the item at a specific position of the list.
Throws System.IndexOutOfRangeException if i is negative or >= the size of the collection.
Returns: The removed item.
i: The index of the item to remove.
void RemoveInterval(int start, int count) Remove all items in an index interval.
Throws System.IndexOutOfRangeException???.
start: The index of the first item to remove.
count: The number of items to remove.
bool Contains(T item) Check if this collection contains (an item equivalent to according to the itemhasher) a particular value.
Returns: True if the items is in this collection.
item: The value to check for.
bool Find(ref T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, return in the ref argument (a binary copy of) the actual value found.
Returns: True if the items is in this collection.
item: The value to look for.
bool Update(T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, update the item in the collection to with a binary copy of the supplied value.
Returns: True if the item was found and hence updated.
item: Value to update.
bool FindOrAdd(ref T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, return in the ref argument (a binary copy of) the actual value found. Else, add the item to the collection.
Returns: True if the item was found (hence not added).
item: The value to look for.
bool UpdateOrAdd(T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, update the item in the collection to with a binary copy of the supplied value; else add the value to the collection.
Returns: True if the item was found and updated (hence not added).
item: Value to add or update.
bool Remove(T item) Remove a particular item from this collection.
Returns: True if the item was found (and removed).
item: The value to remove.
bool RemoveWithReturn(ref T item) Remove a particular item from this collection if found. If an item was removed, report a binary copy of the actual item removed in the argument.
Returns: True if the item was found (and removed).
item: The value to remove on input.
void RemoveAll(System.Collections.Generic.IEnumerable<T> items) Remove all items in another collection from this one.
items: The items to remove.
void Clear() Remove all items from this collection.
void RetainAll(System.Collections.Generic.IEnumerable<T> items) Remove all items not in some other collection from this one.
items: The items to retain.
bool ContainsAll(System.Collections.Generic.IEnumerable<T> items) Check if this collection contains all the values in another collection Multiplicities are not taken into account.
Returns: True if all values in itemsis in this collection.
items: The
int ContainsCount(T item) Count the number of items of the collection equal to a particular value. Returns 0 if and only if the value is not in the collection.
Returns: The number of copies found.
item: The value to count.
void RemoveAllCopies(T item) Remove all items equivalent to a given value.
item: The value to remove.
bool Add(T item) Add an item to this collection if possible. Since this collection has set semantics, the item will be added if not already in the collection.
Returns: True if item was added.
item: The item to add.
void AddAll(System.Collections.Generic.IEnumerable<T> items) Add the elements from another collection to this collection. Only items not already in the collection will be added.
items: The items to add.
bool Check() Check the integrity of the internal data structures of this collection. Only avaliable in DEBUG builds???
Returns: True if check does not fail.
IList<V> Map<V>(Mapper<T,V> mapper) Inherited from LinkedList{T}: IList<V> Map<V>(Mapper<T,V> mapper)
IList<V> Map<V>(Mapper<T,V> mapper, IHasher<V> hasher) Inherited from LinkedList{T}: IList<V> Map<V>(Mapper<T,V> mapper, IHasher<V> hasher)
Pvoid updatecheck() Inherited from LinkedList{T}: void updatecheck()
NPvoid modifycheck() Inherited from LinkedList{T}: void modifycheck()
Pvoid modifycheck(int stamp) Inherited from LinkedList{T}: void modifycheck(int stamp)
NPvoid insertNode(LinkedList<T>.Node succ, LinkedList<T>.Node newnode) Inherited from LinkedList{T}: void insertNode(LinkedList<T>.Node succ, LinkedList<T>.Node newnode)
NPT remove(LinkedList<T>.Node node) Inherited from LinkedList{T}: T remove(LinkedList<T>.Node node)
NPLinkedList<T>.TagGroup gettaggroup(LinkedList<T>.Node pred, LinkedList<T>.Node succ, out int lowbound, out int highbound) Inherited from LinkedList{T}: LinkedList<T>.TagGroup gettaggroup(LinkedList<T>.Node pred, LinkedList<T>.Node succ, out int lowbound, out int highbound)
NPvoid settag(LinkedList<T>.Node node) Inherited from LinkedList{T}: void settag(LinkedList<T>.Node node)
NPvoid removefromtaggroup(LinkedList<T>.Node node) Inherited from LinkedList{T}: void removefromtaggroup(LinkedList<T>.Node node)
NPvoid splittaggroup(LinkedList<T>.TagGroup taggroup) Inherited from LinkedList{T}: void splittaggroup(LinkedList<T>.TagGroup taggroup)
NPLinkedList<T>.Node get(int n) Inherited from LinkedList{T}: LinkedList<T>.Node get(int n)
void Slide(int offset) Inherited from LinkedList{T}: void Slide(int offset)
void Slide(int offset, int size) Inherited from LinkedList{T}: void Slide(int offset, int size)
void Reverse() Inherited from LinkedList{T}: void Reverse()
bool IsSorted(IComparer<T> c) Inherited from LinkedList{T}: bool IsSorted(IComparer<T> c)
void Sort(IComparer<T> c) Inherited from LinkedList{T}: void Sort(IComparer<T> c)
void Shuffle() Inherited from LinkedList{T}: void Shuffle()
IDirectedCollectionValue<T> Backwards() Inherited from LinkedList{T}: IDirectedCollectionValue<T> Backwards()
IList<T> FindAll(Filter<T> filter) Inherited from LinkedList{T}: IList<T> FindAll(Filter<T> filter)
System.Collections.Generic.IEnumerator<T> GetEnumerator() Inherited from LinkedList{T}: System.Collections.Generic.IEnumerator<T> GetEnumerator()
void Push(T item) Inherited from LinkedList{T}: void Push(T item)
T Pop() Inherited from LinkedList{T}: T Pop()
void EnQueue(T item) Inherited from LinkedList{T}: void EnQueue(T item)
T DeQueue() Inherited from LinkedList{T}: T DeQueue()
NPint sequencedhashcode() Inherited from SequencedBase{T}: int sequencedhashcode()
NPbool sequencedequals(ISequenced<T> that) Inherited from SequencedBase{T}: bool sequencedequals(ISequenced<T> that)
NPvoid checkRange(int start, int count) Inherited from CollectionBase{T}: void checkRange(int start, int count)
NPint unsequencedhashcode() Inherited from CollectionBase{T}: int unsequencedhashcode()
NPbool unsequencedequals(ICollection<T> that) Inherited from CollectionBase{T}: bool unsequencedequals(ICollection<T> that)
void CopyTo(T[] a, int i) Inherited from CollectionValueBase{T}: void CopyTo(T[] a, int i)
T[] ToArray() Inherited from CollectionValueBase{T}: T[] ToArray()
void Apply(Applier<T> a) Inherited from CollectionValueBase{T}: void Apply(Applier<T> a)
bool Exists(Filter<T> filter) Inherited from CollectionValueBase{T}: bool Exists(Filter<T> filter)
bool All(Filter<T> filter) Inherited from CollectionValueBase{T}: bool All(Filter<T> filter)
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class HashDictionary<K,V>

A generic dictionary class based on a hash set class See .

Implements

System.Collections.Generic.IEnumerable<KeyValuePair<K,V>>, IDictionary<K,V>

Bases

object, EnumerableBase<KeyValuePair<K,V>>, DictionaryBase<K,V>

Field overview

ICollection<KeyValuePair<K,V>> pairs

Property overview

int Count, bool IsReadOnly, V this[K key], ICollectionValue<K> Keys, object SyncRoot, ICollectionValue<V> Values

Constructor overview

HashDictionary<K,V>(), HashDictionary<K,V>(IHasher<K> h), HashDictionary<K,V>(int capacity, double fill, IHasher<K> h)

Method overview

void Add(K key, V val), bool Check(), void Clear(), bool Contains(K key), bool Equals(object obj), void Finalize(), bool Find(K key, out V val), bool FindOrAdd(K key, ref V val), System.Collections.Generic.IEnumerator<KeyValuePair<K,V>> GetEnumerator(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), bool Remove(K key), bool Remove(K key, out V val), string ToString(), bool Update(K key, V val), bool UpdateOrAdd(K key, V val)

Field details

PICollection<KeyValuePair<K,V>> pairs Inherited from DictionaryBase{K,V}: ICollection<KeyValuePair<K,V>> pairs

Property details

int Count Inherited from DictionaryBase{K,V}: int Count
object SyncRoot Inherited from DictionaryBase{K,V}: object SyncRoot
ICollectionValue<K> Keys Inherited from DictionaryBase{K,V}: ICollectionValue<K> Keys
ICollectionValue<V> Values Inherited from DictionaryBase{K,V}: ICollectionValue<V> Values
V this[K key] Inherited from DictionaryBase{K,V}: V this[K key]
bool IsReadOnly Inherited from DictionaryBase{K,V}: bool IsReadOnly

Constructor details

HashDictionary<K,V>() Create a hash dictionary using a default hasher for the keys. Initial capacity of internal table will be 16 entries and threshold for expansion is 66% fill.
HashDictionary<K,V>(IHasher<K> h) Create a hash dictionary using a custom hasher for the keys. Initial capacity of internal table will be 16 entries and threshold for expansion is 66% fill.
h: The external key hasher
HashDictionary<K,V>(int capacity, double fill, IHasher<K> h) Create a hash dictionary using a custom hasher and prescribing the initial size of the dictionary and a non-default threshold for internal table expansion.
capacity: The initial capacity. Will be rounded upwards to nearest power of 2, at least 16.
fill: The expansion threshold. Must be between 10% and 90%.
h: The external key hasher

Method details

void Add(K key, V val) Inherited from DictionaryBase{K,V}: void Add(K key, V val)
bool Remove(K key) Inherited from DictionaryBase{K,V}: bool Remove(K key)
bool Remove(K key, out V val) Inherited from DictionaryBase{K,V}: bool Remove(K key, out V val)
void Clear() Inherited from DictionaryBase{K,V}: void Clear()
bool Contains(K key) Inherited from DictionaryBase{K,V}: bool Contains(K key)
bool Find(K key, out V val) Inherited from DictionaryBase{K,V}: bool Find(K key, out V val)
bool Update(K key, V val) Inherited from DictionaryBase{K,V}: bool Update(K key, V val)
bool FindOrAdd(K key, ref V val) Inherited from DictionaryBase{K,V}: bool FindOrAdd(K key, ref V val)
bool UpdateOrAdd(K key, V val) Inherited from DictionaryBase{K,V}: bool UpdateOrAdd(K key, V val)
bool Check() Inherited from DictionaryBase{K,V}: bool Check()
System.Collections.Generic.IEnumerator<KeyValuePair<K,V>> GetEnumerator() Inherited from DictionaryBase{K,V}: System.Collections.Generic.IEnumerator<KeyValuePair<K,V>> GetEnumerator()
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class ComparerBuilder.FromComparable<T>

A default item comparer for an item type that is either generic (IComparable<T>) or ordinarily (System.IComparable) comparable.

Bases

object

Constructor overview

ComparerBuilder.FromComparable<T>()

Method overview

bool Equals(object obj), IComparer<T> Examine(), void Finalize(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), string ToString()

Constructor details

ComparerBuilder.FromComparable<T>()

Method details

NSIComparer<T> Examine() Create a default comparer
Throws System.ArgumentException if T is not comparable.
Returns: The comparer
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class HasherBuilder.SequencedHasher<S,W>

Prototype for an sequenced hasher for IIndexed[W] This will use the IIndexed[W] specific operations

Implements

IHasher<S>

Bases

object

Constructor overview

HasherBuilder.SequencedHasher<S,W>()

Method overview

bool Equals(S i1, S i2), bool Equals(object obj), void Finalize(), int GetHashCode(S item), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), string ToString()

Constructor details

HasherBuilder.SequencedHasher<S,W>()

Method details

int GetHashCode(S item) Get the hash code with respect to this sequenced hasher
Returns: The hash code
item: The item
bool Equals(S i1, S i2) Check if two items are equal with respect to this sequenced hasher
Returns: True if equal
i1: first item
i2: second item
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class HasherBuilder.UnsequencedHasher<S,W>

Prototype for an unsequenced hasher for ICollection[W] This will use the ICollection[W] specific operations

Implements

IHasher<S>

Bases

object

Constructor overview

HasherBuilder.UnsequencedHasher<S,W>()

Method overview

bool Equals(S i1, S i2), bool Equals(object obj), void Finalize(), int GetHashCode(S item), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), string ToString()

Constructor details

HasherBuilder.UnsequencedHasher<S,W>()

Method details

int GetHashCode(S item) Get the hash code with respect to this unsequenced hasher
Returns: The hash code
item: The item
bool Equals(S i1, S i2) Check if two items are equal with respect to this unsequenced hasher
Returns: True if equal
i1: first item
i2: second item
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class HasherBuilder.ByPrototype<T>

Create a hasher for T that is DefaultValueTypeHasher[T] or DefaultReferenceTypeHasher[T] unless T has been instatiated to a type of the exact form IIndexed[W] or ICollection[W] in which case Examine will return Sequenced- repectively UnsequencedHasher.

Bases

object

Constructor overview

HasherBuilder.ByPrototype<T>()

Method overview

bool Equals(object obj), IHasher<T> Examine(), void Finalize(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), string ToString()

Constructor details

HasherBuilder.ByPrototype<T>()

Method details

NSIHasher<T> Examine() See class description
Returns: The hasher
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class HasherBuilder.ByInvoke<T>

IHasher factory class: examines at instatiation time if T is an interface implementing "int GetHashCode()" and "bool Equals(T)". If those are not present, MakeHasher will return a default hasher, else this class will implement Ihasher[T] via Invoke() on the reflected method infos.

Implements

IHasher<T>

Bases

object

Method overview

bool Equals(T i1, T i2), bool Equals(object obj), void Finalize(), int GetHashCode(T item), int GetHashCode(), System.Type GetType(), IHasher<T> MakeHasher(), object MemberwiseClone(), string ToString()

Method details

NSIHasher<T> MakeHasher()
Returns:
int GetHashCode(T item)
Returns:
item:
bool Equals(T i1, T i2)
Returns:
i1:
i2:
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class HasherBuilder.ByRTCG

Like ByInvoke, but tries to build a hasher by RTCG to avoid the Invoke() overhead. Does not work as intended because of a Whidbey RTCG bug.

Bases

object

Constructor overview

HasherBuilder.ByRTCG()

Method overview

IHasher<T> build<T>(), IHasher<T> CreateHasher<T>(System.Reflection.MethodInfo hinfo, System.Reflection.MethodInfo einfo), void dump(), bool Equals(object obj), void Finalize(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), string ToString()

Constructor details

HasherBuilder.ByRTCG()

Method details

NSIHasher<T> CreateHasher<T>(System.Reflection.MethodInfo hinfo, System.Reflection.MethodInfo einfo)
Returns:
hinfo:
einfo:
NSIHasher<T> build<T>()
Returns:
Nvoid dump()
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class HashSet<T>

A set collection class based on linear hashing

Implements

System.Collections.Generic.IEnumerable<T>, ICollection<T>, ICollectionValue<T>, IExtensible<T>

Bases

object, EnumerableBase<T>, CollectionValueBase<T>, CollectionBase<T>

Field overview

bool isReadOnly, IHasher<T> itemhasher, int size, int stamp

Property overview

bool AllowsDuplicates, Speed ContainsSpeed, int Count, Speed CountSpeed, HashSet<T>.Feature Features, bool IsEmpty, bool IsReadOnly, object SyncRoot

Constructor overview

HashSet<T>(), HashSet<T>(IHasher<T> itemhasher), HashSet<T>(int capacity, IHasher<T> itemhasher), HashSet<T>(int capacity, double fill, IHasher<T> itemhasher)

Method overview

bool Add(T item), void AddAll<U>(System.Collections.Generic.IEnumerable<U> items), void AddAll(System.Collections.Generic.IEnumerable<T> items), bool All(Filter<T> filter), void Apply(Applier<T> a), ISortedDictionary<int,int> BucketSizeDistribution(), bool Check(), void checkRange(int start, int count), void Clear(), bool Contains(T item), bool ContainsAll(System.Collections.Generic.IEnumerable<T> items), int ContainsCount(T item), void CopyTo(T[] a, int i), bool Equals(object obj), bool Exists(Filter<T> filter), void Finalize(), bool Find(ref T item), bool FindOrAdd(ref T item), System.Collections.Generic.IEnumerator<T> GetEnumerator(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), void modifycheck(int thestamp), bool Remove(T item), void RemoveAll(System.Collections.Generic.IEnumerable<T> items), void RemoveAllCopies(T item), bool RemoveWithReturn(ref T item), void RetainAll(System.Collections.Generic.IEnumerable<T> items), T[] ToArray(), string ToString(), bool unsequencedequals(ICollection<T> that), int unsequencedhashcode(), bool Update(T item), void updatecheck(), bool UpdateOrAdd(T item)

Field details

Pbool isReadOnly Inherited from CollectionBase{T}: bool isReadOnly
Pint stamp Inherited from CollectionBase{T}: int stamp
Pint size Inherited from CollectionBase{T}: int size
PIHasher<T> itemhasher Inherited from CollectionBase{T}: IHasher<T> itemhasher

Property details

HashSet<T>.Feature Features Show which implementation features was chosen at compilation time
Speed ContainsSpeed Value: Always returns Speed.ConstantThe complexity of the Contains operation
bool AllowsDuplicates Value: Always falseReport if this is a set collection.
bool IsReadOnly Inherited from CollectionBase{T}: bool IsReadOnly
int Count Inherited from CollectionBase{T}: int Count
Speed CountSpeed Inherited from CollectionBase{T}: Speed CountSpeed
object SyncRoot Inherited from CollectionBase{T}: object SyncRoot
bool IsEmpty Inherited from CollectionBase{T}: bool IsEmpty

Constructor details

HashSet<T>() Create a hash set with natural item hasher and default fill threshold (66%) and initial table size (16).
HashSet<T>(IHasher<T> itemhasher) Create a hash set with external item hasher and default fill threshold (66%) and initial table size (16).
itemhasher: The external item hasher
HashSet<T>(int capacity, IHasher<T> itemhasher) Create a hash set with external item hasher and default fill threshold (66%)
capacity: Initial table size (rounded to power of 2, at least 16)
itemhasher: The external item hasher
HashSet<T>(int capacity, double fill, IHasher<T> itemhasher) Create a hash set with external item hasher.
capacity: Initial table size (rounded to power of 2, at least 16)
fill: Fill threshold (in range 10% to 90%)
itemhasher: The external item hasher

Method details

void AddAll<U>(System.Collections.Generic.IEnumerable<U> items) Add the elements from another collection with a more specialized item type to this collection. Since this collection has set semantics, only items not already in the collection will be added.
items: The items to add
bool Contains(T item) Check if an item is in the set
Returns: True if set contains item
item: The item to look for
bool Find(ref T item) Check if an item (collection equal to a given one) is in the set and if so report the actual item object found.
Returns: True if set contains item
item: On entry, the item to look for. On exit the item found, if any
bool Update(T item) Check if an item (collection equal to a given one) is in the set and if so replace the item object in the set with the supplied one.
Returns: True if item was found (and updated)
item: The item object to update with
bool FindOrAdd(ref T item) Check if an item (collection equal to a given one) is in the set. If found, report the actual item object in the set, else add the supplied one.
Returns: True if item was found
item: On entry, the item to look for or add. On exit the actual object found, if any.
bool UpdateOrAdd(T item) Check if an item (collection equal to a supplied one) is in the set and if so replace the item object in the set with the supplied one; else add the supplied one.
Returns: True if item was updated
item: The item to look for and update or add
bool Remove(T item) Remove an item from the set
Returns: True if item was (found and) removed
item: The item to remove
bool RemoveWithReturn(ref T item) Remove an item from the set, reporting the actual matching item object.
Returns: True if item was found.
item: On entry the item to remove. On exit, the actual removed item object.
void RemoveAll(System.Collections.Generic.IEnumerable<T> items) Remove all items in a supplied collection from this set.
items: The items to remove.
void Clear() Remove all items from the set, resetting internal table to initial size.
void RetainAll(System.Collections.Generic.IEnumerable<T> items) Remove all items *not* in a supplied collection from this set.
items: The items to retain
bool ContainsAll(System.Collections.Generic.IEnumerable<T> items) Check if all items in a supplied collection is in this set (ignoring multiplicities).
Returns: True if all items are found.
items: The items to look for.
T[] ToArray() Create an array containing all items in this set (in enumeration order).
Returns: The array
int ContainsCount(T item) Count the number of times an item is in this set (either 0 or 1).
Returns: 1 if item is in set, 0 else
item: The item to look for.
void RemoveAllCopies(T item) Remove all (at most 1) copies of item from this set.
item: The item to remove
System.Collections.Generic.IEnumerator<T> GetEnumerator() Create an enumerator for this set.
Returns: The enumerator
bool Add(T item) Add an item to this set.
Returns: True if item was added (i.e. not found)
item: The item to add.
void AddAll(System.Collections.Generic.IEnumerable<T> items) Add all items of a collection to this set.
items: The items to add
bool Check() Test internal structure of data (invariants)
Returns: True if pass
NISortedDictionary<int,int> BucketSizeDistribution() Produce statistics on distribution of bucket sizes. Current implementation is incomplete.
Returns: Histogram data.
NPvoid checkRange(int start, int count) Inherited from CollectionBase{T}: void checkRange(int start, int count)
NPint unsequencedhashcode() Inherited from CollectionBase{T}: int unsequencedhashcode()
NPbool unsequencedequals(ICollection<T> that) Inherited from CollectionBase{T}: bool unsequencedequals(ICollection<T> that)
Pvoid modifycheck(int thestamp) Inherited from CollectionBase{T}: void modifycheck(int thestamp)
Pvoid updatecheck() Inherited from CollectionBase{T}: void updatecheck()
void CopyTo(T[] a, int i) Inherited from CollectionValueBase{T}: void CopyTo(T[] a, int i)
void Apply(Applier<T> a) Inherited from CollectionValueBase{T}: void Apply(Applier<T> a)
bool Exists(Filter<T> filter) Inherited from CollectionValueBase{T}: bool Exists(Filter<T> filter)
bool All(Filter<T> filter) Inherited from CollectionValueBase{T}: bool All(Filter<T> filter)
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class TreeSet<T>

An implementation of Red-Black trees as an indexed, sorted collection with set semantics, cf. CLRS. See for a version with bag semantics. See for a sorted dictionary based on this tree implementation.

The comparer (sorting order) may be either natural, because the item type is comparable (generic: See or non-generic: System.IComparable) or it can be external and supplied by the user in the constructor.

TODO: describe performance here

TODO: discuss persistence and its useful usage modes. Warn about the space leak possible with other usage modes.

Implements

System.Collections.Generic.IEnumerable<T>, System.IDisposable, ICollection<T>, ICollectionValue<T>, IDirectedCollectionValue<T>, IDirectedEnumerable<T>, IExtensible<T>, IIndexed<T>, IIndexedSorted<T>, IPersistentSorted<T>, IPriorityQueue<T>, ISequenced<T>, ISorted<T>

Bases

object, EnumerableBase<T>, CollectionValueBase<T>, CollectionBase<T>, SequencedBase<T>

Field overview

bool isReadOnly, IHasher<T> itemhasher, int size, int stamp

Property overview

bool AllowsDuplicates, IComparer<T> Comparer, Speed ContainsSpeed, int Count, Speed CountSpeed, EnumerationDirection Direction, TreeSet<T>.Feature Features, bool IsEmpty, bool IsReadOnly, T this[int i], IDirectedCollectionValue<T> this[int start, int end], object SyncRoot

Constructor overview

TreeSet<T>(), TreeSet<T>(IComparer<T> c), TreeSet<T>(IComparer<T> c, IHasher<T> h)

Method overview

bool Add(T item), void AddAll<U>(System.Collections.Generic.IEnumerable<U> items), void AddAll(System.Collections.Generic.IEnumerable<T> items), void AddSorted(System.Collections.Generic.IEnumerable<T> items), bool All(Filter<T> filter), void Apply(Applier<T> a), IDirectedCollectionValue<T> Backwards(), bool Check(string name), bool Check(), void checkRange(int start, int count), void Clear(), bool Contains(T item), bool ContainsAll(System.Collections.Generic.IEnumerable<T> items), int ContainsCount(T item), void CopyTo(T[] a, int i), int CountFrom(T bot), int CountFromTo(T bot, T top), int CountTo(T top), bool Cut(System.IComparable<T> c, out T low, out bool lowIsValid, out T high, out bool highIsValid), T DeleteMax(), T DeleteMin(), void Dispose(), void dump(), void dump(string msg), bool Equals(object obj), bool Exists(Filter<T> filter), void Finalize(), bool Find(ref T item), IIndexedSorted<T> FindAll(Filter<T> filter), T FindMax(), T FindMin(), bool FindOrAdd(ref T item), System.Collections.Generic.IEnumerator<T> GetEnumerator(), int GetHashCode(), System.Type GetType(), int IndexOf(T item), int LastIndexOf(T item), IIndexedSorted<V> Map<V>(Mapper<T,V> mapper, IComparer<V> c), object MemberwiseClone(), void modifycheck(int thestamp), T Predecessor(T item), IDirectedCollectionValue<T> RangeAll(), IDirectedCollectionValue<T> RangeFrom(T bot), IDirectedCollectionValue<T> RangeFromTo(T bot, T top), IDirectedCollectionValue<T> RangeTo(T top), bool Remove(T item), void RemoveAll(System.Collections.Generic.IEnumerable<T> items), void RemoveAllCopies(T item), T RemoveAt(int i), void RemoveInterval(int start, int count), void RemoveRangeFrom(T low), void RemoveRangeFromTo(T low, T hi), void RemoveRangeTo(T hi), bool RemoveWithReturn(ref T item), void RetainAll(System.Collections.Generic.IEnumerable<T> items), bool sequencedequals(ISequenced<T> that), int sequencedhashcode(), ISorted<T> Snapshot(), T Successor(T item), T[] ToArray(), string ToString(), bool unsequencedequals(ICollection<T> that), int unsequencedhashcode(), bool Update(T item), void updatecheck(), bool UpdateOrAdd(T item), T WeakPredecessor(T item), T WeakSuccessor(T item)

Field details

Pbool isReadOnly Inherited from CollectionBase{T}: bool isReadOnly
Pint stamp Inherited from CollectionBase{T}: int stamp
Pint size Inherited from CollectionBase{T}: int size
PIHasher<T> itemhasher Inherited from CollectionBase{T}: IHasher<T> itemhasher

Property details

TreeSet<T>.Feature Features A debugging aid for making the selected compilation alternatives available to the user. (To be removed when selection is finally fixed for production version).
bool AllowsDuplicates Value: False since this tree has set semantics.
Speed ContainsSpeed Value: Speed.LogThe value is symbolic indicating the type of asymptotic complexity in terms of the size of this collection (worst-case or amortized as relevant).
T this[int i] Value: The i'th item of this list.
Throws System.IndexOutOfRangeException if i is negative or >= the size of the collection.
i: the index to lookup
IDirectedCollectionValue<T> this[int start, int end] Value: The directed collection of items in a specific index interval.
Throws System.IndexOutOfRangeException.
start: The low index of the interval (inclusive).
end: The high index of the interval (exclusive).
IComparer<T> Comparer Value: The comparerThe comparer object supplied at creation time for this collection
EnumerationDirection Direction Inherited from SequencedBase{T}: EnumerationDirection Direction
bool IsReadOnly Inherited from CollectionBase{T}: bool IsReadOnly
int Count Inherited from CollectionBase{T}: int Count
Speed CountSpeed Inherited from CollectionBase{T}: Speed CountSpeed
object SyncRoot Inherited from CollectionBase{T}: object SyncRoot
bool IsEmpty Inherited from CollectionBase{T}: bool IsEmpty

Constructor details

TreeSet<T>() Create a red-black tree collection with natural comparer and item hasher.
TreeSet<T>(IComparer<T> c) Create a red-black tree collection with an external comparer (and natural item hasher, assumed consistent).
c: The external comparer
TreeSet<T>(IComparer<T> c, IHasher<T> h) Create a red-black tree collection with an external comparer aand an external item hasher, assumed consistent.
c: The external comparer
h: The external item hasher

Method details

void AddAll<U>(System.Collections.Generic.IEnumerable<U> items) Add the elements from another collection with a more specialized item type to this collection. If this collection has set semantics, only items not already in the collection will be added.
items: The items to add
IIndexedSorted<V> Map<V>(Mapper<T,V> mapper, IComparer<V> c) Create a new indexed sorted collection consisting of the results of mapping all items of this list.
Throws System.ArgumentException if the map is not increasing over the items of this collection (with respect to the two given comparison relations).
Returns: The new sorted collection.
mapper: The delegate definging the map.
c: The comparion relation to use for the result.
System.Collections.Generic.IEnumerator<T> GetEnumerator() Create an enumerator for this tree
Returns: The enumerator
bool Add(T item) Add an item to this collection if possible. If this collection has set semantics, the item will be added if not already in the collection. If bag semantics, the item will always be added.
Returns: True if item was added.
item: The item to add.
void AddAll(System.Collections.Generic.IEnumerable<T> items) Add the elements from another collection to this collection. If this collection has set semantics, only items not already in the collection will be added.
items: The items to add.
void AddSorted(System.Collections.Generic.IEnumerable<T> items) Add all the items from another collection with an enumeration order that is increasing in the items. The idea is that the implementation may use a faster algorithm to merge the two collections.
Throws System.ArgumentException if the enumerated items turns out not to be in increasing order.
items: The collection to add.
bool Contains(T item) Check if this collection contains (an item equivalent to according to the itemhasher) a particular value.
Returns: True if the items is in this collection.
item: The value to check for.
bool Find(ref T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, return in the ref argument (a binary copy of) the actual value found.
Returns: True if the items is in this collection.
item: The value to look for.
bool FindOrAdd(ref T item) Find or add the item to the tree. If the tree does not contain an item equivalent to this item add it, else return the exisiting one in the ref argument.
Returns: True if item was found
item:
bool Update(T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, update the item in the collection to with a binary copy of the supplied value. If the collection has bag semantics, this updates all equivalent copies in the collection.
Returns: True if the item was found and hence updated.
item: Value to update.
bool UpdateOrAdd(T item) Check if this collection contains an item equivalent according to the itemhasher to a particular value. If so, update the item in the collection to with a binary copy of the supplied value; else add the value to the collection.

NOTE: the bag implementation is currently wrong!

Returns: True if the item was found and updated (hence not added).
item: Value to add or update.
bool Remove(T item) Remove a particular item from this collection. If the collection has bag semantics only one copy equivalent to the supplied item is removed.
Returns: True if the item was found (and removed).
item: The value to remove.
bool RemoveWithReturn(ref T item) Remove a particular item from this collection if found. If the collection has bag semantics only one copy equivalent to the supplied item is removed, which one is implementation dependent. If an item was removed, report a binary copy of the actual item removed in the argument.
Returns: True if the item was found (and removed).
item: The value to remove on input.
void Clear() Remove all items from this collection.
void RemoveAll(System.Collections.Generic.IEnumerable<T> items) Remove all items in another collection from this one. If this collection has bag semantics, take multiplicities into account.
items: The items to remove.
void RetainAll(System.Collections.Generic.IEnumerable<T> items) Remove all items not in some other collection from this one. If this collection has bag semantics, take multiplicities into account.
items: The items to retain.
bool ContainsAll(System.Collections.Generic.IEnumerable<T> items) Check if this collection contains all the values in another collection. If this collection has bag semantics (NoDuplicates==false) the check is made with respect to multiplicities, else multiplicities are not taken into account.
Returns: True if all values in itemsis in this collection.
items: The
IIndexedSorted<T> FindAll(Filter<T> filter) Create a new indexed sorted collection consisting of the items of this indexed sorted collection satisfying a certain predicate.
Returns: The new indexed sorted collection.
filter: The filter delegate defining the predicate.
int ContainsCount(T item) Count the number of items of the collection equal to a particular value. Returns 0 if and only if the value is not in the collection.
Returns: The number of copies found.
item: The value to count.
void RemoveAllCopies(T item) Remove all items equivalent to a given value.
item: The value to remove.
int IndexOf(T item) Searches for an item in the list going forwrds from the start.
Returns: Index of item from start.
item: Item to search for.
int LastIndexOf(T item) Searches for an item in the list going backwords from the end.
Returns: Index of of item from the end.
item: Item to search for.
T RemoveAt(int i) Remove the item at a specific position of the list.
Throws System.IndexOutOfRangeException if i is negative or >= the size of the collection.
Returns: The removed item.
i: The index of the item to remove.
void RemoveInterval(int start, int count) Remove all items in an index interval.
Throws System.IndexOutOfRangeException???.
start: The index of the first item to remove.
count: The number of items to remove.
IDirectedCollectionValue<T> Backwards() Create a collection containing the same items as this collection, but whose enumerator will enumerate the items backwards. The new collection will become invalid if the original is modified. Method typicaly used as in foreach (T x in coll.Backwards()) {...}
Returns: The backwards collection.
T FindMin() Find the current least item of this priority queue.
Returns: The least item.
T DeleteMin() Remove the least item from this priority queue.
Returns: The removed item.
T FindMax() Find the current largest item of this priority queue.
Returns: The largest item.
T DeleteMax() Remove the largest item from this priority queue.
Returns: The removed item.
T Predecessor(T item) Find the strict predecessor in the sorted collection of a particular value, i.e. the largest item in the collection less than the supplied value.
Throws System.InvalidOperationException if no such element exists (the supplied value is less than or equal to the minimum of this collection.)
Returns: The predecessor.
item: The item to find the predecessor for.
T WeakPredecessor(T item) Find the weak predecessor in the sorted collection of a particular value, i.e. the largest item in the collection less than or equal to the supplied value.
Throws System.InvalidOperationException if no such element exists (the supplied value is less than the minimum of this collection.)
Returns: The weak predecessor.
item: The item to find the weak predecessor for.
T Successor(T item) Find the strict successor in the sorted collection of a particular value, i.e. the least item in the collection greater than the supplied value.
Throws System.InvalidOperationException if no such element exists (the supplied value is greater than or equal to the maximum of this collection.)
Returns: The successor.
item: The item to find the successor for.
T WeakSuccessor(T item) Find the weak successor in the sorted collection of a particular value, i.e. the least item in the collection greater than or equal to the supplied value.
Throws System.InvalidOperationException if no such element exists (the supplied value is greater than the maximum of this collection.)
Returns: The weak successor.
item: The item to find the weak successor for.
IDirectedCollectionValue<T> RangeFrom(T bot) Query this sorted collection for items greater than or equal to a supplied value.
Returns: The result directed collection.
bot: The lower bound (inclusive).
IDirectedCollectionValue<T> RangeFromTo(T bot, T top) Query this sorted collection for items between two supplied values.
Returns: The result directed collection.
bot: The lower bound (inclusive).
top: The upper bound (exclusive).
IDirectedCollectionValue<T> RangeTo(T top) Query this sorted collection for items less than a supplied value.
Returns: The result directed collection.
top: The upper bound (exclusive).
IDirectedCollectionValue<T> RangeAll() Create a directed collection with the same items as this collection.
Returns: The result directed collection.
bool Cut(System.IComparable<T> c, out T low, out bool lowIsValid, out T high, out bool highIsValid) Perform a search in the sorted collection for the ranges in which a non-decreasing function from the item type to int is negative, zero respectively positive. If the supplied cut function is not non-decreasing, the result of this call is undefined.
Returns:
c: The cut function T to int, given as an IComparable<T> object, where the cut function is the c.CompareTo(T that) method.
low: Returns the largest item in the collection, where the cut function is negative (if any).
lowIsValid: True if the cut function is negative somewhere on this collection.
high: Returns the least item in the collection, where the cut function is positive (if any).
highIsValid: True if the cut function is positive somewhere on this collection.
int CountFrom(T bot) Determine the number of items at or above a supplied threshold.
Returns: The number of matcing items.
bot: The lower bound (inclusive)
int CountFromTo(T bot, T top) Determine the number of items between two supplied thresholds.
Returns: The number of matcing items.
bot: The lower bound (inclusive)
top: The upper bound (exclusive)
int CountTo(T top) Determine the number of items below a supplied threshold.
Returns: The number of matcing items.
top: The upper bound (exclusive)
void RemoveRangeFrom(T low) Remove all items of this collection above or at a supplied threshold.
low: The lower threshold (inclusive).
void RemoveRangeFromTo(T low, T hi) Remove all items of this collection between two supplied thresholds.
low: The lower threshold (inclusive).
hi: The upper threshold (exclusive).
void RemoveRangeTo(T hi) Remove all items of this collection below a supplied threshold.
hi: The upper threshold (exclusive).
void Dispose() If this tree is a snapshot, remove registration in base tree
Pvoid Finalize() If this tree is a snapshot, remove registration in base tree
ISorted<T> Snapshot() Make a (read-only) snap shot of this collection.
Returns: The snap shot.
Nvoid dump() Print the tree structure to the console stdout.
Nvoid dump(string msg) Print the tree structure to the console stdout.
msg:
Nbool Check(string name) Checks red-black invariant. Dumps tree to console if bad
Returns: false if invariant violation
name: Title of dump
bool Check() Checks red-black invariant. Dumps tree to console if bad
Returns: false if invariant violation
NPint sequencedhashcode() Inherited from SequencedBase{T}: int sequencedhashcode()
NPbool sequencedequals(ISequenced<T> that) Inherited from SequencedBase{T}: bool sequencedequals(ISequenced<T> that)
NPvoid checkRange(int start, int count) Inherited from CollectionBase{T}: void checkRange(int start, int count)
NPint unsequencedhashcode() Inherited from CollectionBase{T}: int unsequencedhashcode()
NPbool unsequencedequals(ICollection<T> that) Inherited from CollectionBase{T}: bool unsequencedequals(ICollection<T> that)
Pvoid modifycheck(int thestamp) Inherited from CollectionBase{T}: void modifycheck(int thestamp)
Pvoid updatecheck() Inherited from CollectionBase{T}: void updatecheck()
void CopyTo(T[] a, int i) Inherited from CollectionValueBase{T}: void CopyTo(T[] a, int i)
T[] ToArray() Inherited from CollectionValueBase{T}: T[] ToArray()
void Apply(Applier<T> a) Inherited from CollectionValueBase{T}: void Apply(Applier<T> a)
bool Exists(Filter<T> filter) Inherited from CollectionValueBase{T}: bool Exists(Filter<T> filter)
bool All(Filter<T> filter) Inherited from CollectionValueBase{T}: bool All(Filter<T> filter)
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()

Class TreeSet<T>.Enumerator

An enumerator for a red-black tree collection. Based on an explicit stack of subtrees waiting to be enumerated. Currently only used for the tree set enumerators (tree bag enumerators use an iterator block based enumerator).

Implements

System.Collections.Generic.IEnumerator<T>, System.IDisposable

Bases

object

Property overview

T Current

Constructor overview

TreeSet<T>.Enumerator(TreeSet<T> tree)

Method overview

void Dispose(), void Dispose(bool disposing), bool Equals(object obj), void Finalize(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), bool MoveNext(), string ToString()

Property details

T Current Value: The current item of the enumerator.Undefined if enumerator is not valid (MoveNext hash been called returning true)

Constructor details

TreeSet<T>.Enumerator(TreeSet<T> tree) Create a tree enumerator
tree: The red-black tree to enumerate

Method details

bool MoveNext() Move enumerator to next item in tree, or the first item if this is the first call to MoveNext.
Throws System.InvalidOperationException if underlying tree was modified.
Returns: True if enumerator is valid now
void Dispose() Call Dispose(true) and then suppress finalization of this enumerator.
Pvoid Dispose(bool disposing) Remove the internal data (notably the stack array).
disposing: True if called from Dispose(), false if called from the finalizer
Pvoid Finalize() Finalizer for enumeratir
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()

Class TreeSet<T>.SnapEnumerator

An enumerator for a snapshot of a node copy persistent red-black tree collection.

Implements

System.Collections.Generic.IEnumerator<T>, System.IDisposable

Bases

object

Property overview

T Current

Constructor overview

TreeSet<T>.SnapEnumerator(TreeSet<T> tree)

Method overview

bool Equals(object obj), void Finalize(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), bool MoveNext(), string ToString()

Property details

T Current Value: The current value of the enumerator.Undefined if enumerator is not valid (MoveNext hash been called returning true)

Constructor details

TreeSet<T>.SnapEnumerator(TreeSet<T> tree) Creta an enumerator for a snapshot of a node copy persistent red-black tree collection
tree: The snapshot

Method details

bool MoveNext() Move enumerator to next item in tree, or the first item if this is the first call to MoveNext.
Throws System.InvalidOperationException if underlying tree was modified.
Returns: True if enumerator is valid now
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class TreeSet<T>.Range.Enumerator

Implements

System.Collections.Generic.IEnumerator<T>, System.IDisposable

Bases

object

Property overview

T Current

Constructor overview

TreeSet<T>.Range.Enumerator(TreeSet<T>.Range range)

Method overview

void Dispose(), bool Equals(object obj), void Finalize(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), bool MoveNext(), string ToString()

Property details

T Current Value: The current value of the enumerator.Undefined if enumerator is not valid (MoveNext hash been called returning true)

Constructor details

TreeSet<T>.Range.Enumerator(TreeSet<T>.Range range)
range:

Method details

bool MoveNext() Move enumerator to next item in tree, or the first item if this is the first call to MoveNext.
Throws System.InvalidOperationException if underlying tree was modified.
Returns: True if enumerator is valid now
void Dispose()
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class KeyValuePairComparer<K,V>

Default comparer for dictionary entries in a sorted dictionary. Entry comparisons only look at keys.

Implements

IComparer<KeyValuePair<K,V>>

Bases

object

Constructor overview

KeyValuePairComparer<K,V>(IComparer<K> c)

Method overview

int Compare(KeyValuePair<K,V> a, KeyValuePair<K,V> b), bool Equals(object obj), void Finalize(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), string ToString()

Constructor details

KeyValuePairComparer<K,V>(IComparer<K> c) Create an entry comparer for a item comparer of the keys
c: Comparer of keys

Method details

int Compare(KeyValuePair<K,V> a, KeyValuePair<K,V> b) Compare two entries
Returns: The result of comparing the keys
a: First entry
b: Second entry
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Class KeyValuePairHasher<K,V>

Default hasher for dictionary entries. Operations only look at keys.

Implements

IHasher<KeyValuePair<K,V>>

Bases

object

Constructor overview

KeyValuePairHasher<K,V>(), KeyValuePairHasher<K,V>(IHasher<K> c)

Method overview

bool Equals(KeyValuePair<K,V> i1, KeyValuePair<K,V> i2), bool Equals(object obj), void Finalize(), int GetHashCode(KeyValuePair<K,V> item), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), string ToString()

Constructor details

KeyValuePairHasher<K,V>() Create an entry hasher using the default hasher for keys
KeyValuePairHasher<K,V>(IHasher<K> c) Create an entry hasher from a specified item hasher for the keys
c: The key hasher

Method details

int GetHashCode(KeyValuePair<K,V> item) Get the hash code of the entry
Returns: The hash code of the key
item: The entry
bool Equals(KeyValuePair<K,V> i1, KeyValuePair<K,V> i2) Test two entries for equality
Returns: True if keys are equal
i1: First entry
i2: Second entry
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
string ToString() Inherited from object: string ToString()
bool Equals(object obj) Inherited from object: bool Equals(object obj)
int GetHashCode() Inherited from object: int GetHashCode()
Pvoid Finalize() Inherited from object: void Finalize()

Value Type EnumerationDirection

Direction of enumeration order relative to original collection.

Implements

System.IComparable, System.IFormattable, System.IConvertible

Field overview

EnumerationDirection Backwards, EnumerationDirection Forwards, int value__

Method overview

int CompareTo(object target), bool Equals(object obj), void Finalize(), int GetHashCode(), System.Type GetType(), System.TypeCode GetTypeCode(), object MemberwiseClone(), string ToString(), string ToString(string format, System.IFormatProvider provider), string ToString(System.IFormatProvider provider), string ToString(string format)

Field details

int value__
SEnumerationDirection Forwards Same direction
SEnumerationDirection Backwards Opposite direction

Method details

bool Equals(object obj) Inherited from System.Enum: bool Equals(object obj)
int GetHashCode() Inherited from System.Enum: int GetHashCode()
string ToString() Inherited from System.Enum: string ToString()
string ToString(string format, System.IFormatProvider provider) Inherited from System.Enum: string ToString(string format, System.IFormatProvider provider)
int CompareTo(object target) Inherited from System.Enum: int CompareTo(object target)
string ToString(System.IFormatProvider provider) Inherited from System.Enum: string ToString(System.IFormatProvider provider)
System.TypeCode GetTypeCode() Inherited from System.Enum: System.TypeCode GetTypeCode()
Nstring ToString(string format) Inherited from System.Enum: string ToString(string format)
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
Pvoid Finalize() Inherited from object: void Finalize()

Value Type SortedArray<T>.Feature

A debugging artifact. To be removed.

Implements

System.IComparable, System.IFormattable, System.IConvertible

Field overview

SortedArray<T>.Feature Standard, System.Int16 value__

Method overview

int CompareTo(object target), bool Equals(object obj), void Finalize(), int GetHashCode(), System.Type GetType(), System.TypeCode GetTypeCode(), object MemberwiseClone(), string ToString(), string ToString(string format, System.IFormatProvider provider), string ToString(System.IFormatProvider provider), string ToString(string format)

Field details

System.Int16 value__
SSortedArray<T>.Feature Standard A debugging artifact. To be removed.

Method details

bool Equals(object obj) Inherited from System.Enum: bool Equals(object obj)
int GetHashCode() Inherited from System.Enum: int GetHashCode()
string ToString() Inherited from System.Enum: string ToString()
string ToString(string format, System.IFormatProvider provider) Inherited from System.Enum: string ToString(string format, System.IFormatProvider provider)
int CompareTo(object target) Inherited from System.Enum: int CompareTo(object target)
string ToString(System.IFormatProvider provider) Inherited from System.Enum: string ToString(System.IFormatProvider provider)
System.TypeCode GetTypeCode() Inherited from System.Enum: System.TypeCode GetTypeCode()
Nstring ToString(string format) Inherited from System.Enum: string ToString(string format)
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
Pvoid Finalize() Inherited from object: void Finalize()

Value Type TreeBag<T>.Feature

A debugging aid for making the selected compilation alternatives available to the user. (To be removed when selection is finally fixed for production version).

Implements

System.IComparable, System.IFormattable, System.IConvertible

Field overview

TreeBag<T>.Feature Dummy, TreeBag<T>.Feature Heights, TreeBag<T>.Feature NodeCopyPersistence, TreeBag<T>.Feature Ranks, TreeBag<T>.Feature Sizes, TreeBag<T>.Feature Traceid, System.Int16 value__

Method overview

int CompareTo(object target), bool Equals(object obj), void Finalize(), int GetHashCode(), System.Type GetType(), System.TypeCode GetTypeCode(), object MemberwiseClone(), string ToString(), string ToString(string format, System.IFormatProvider provider), string ToString(System.IFormatProvider provider), string ToString(string format)

Field details

System.Int16 value__
STreeBag<T>.Feature Dummy Nothing
STreeBag<T>.Feature NodeCopyPersistence Node copy persistence as explained in Tarjan1
STreeBag<T>.Feature Sizes Maintain sub tree sizes
STreeBag<T>.Feature Heights Maintain precise node heights
STreeBag<T>.Feature Ranks Maintain node ranks (~ black height)
STreeBag<T>.Feature Traceid Maintain unique ids on tree nodes.

Method details

bool Equals(object obj) Inherited from System.Enum: bool Equals(object obj)
int GetHashCode() Inherited from System.Enum: int GetHashCode()
string ToString() Inherited from System.Enum: string ToString()
string ToString(string format, System.IFormatProvider provider) Inherited from System.Enum: string ToString(string format, System.IFormatProvider provider)
int CompareTo(object target) Inherited from System.Enum: int CompareTo(object target)
string ToString(System.IFormatProvider provider) Inherited from System.Enum: string ToString(System.IFormatProvider provider)
System.TypeCode GetTypeCode() Inherited from System.Enum: System.TypeCode GetTypeCode()
Nstring ToString(string format) Inherited from System.Enum: string ToString(string format)
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
Pvoid Finalize() Inherited from object: void Finalize()

Value Type Speed

The symbolic characterization of the speed of lookups for a collection. The values may refer to worst-case, amortized and/or expected asymtotic complexity wrt. the collection size.

Implements

System.IComparable, System.IFormattable, System.IConvertible

Field overview

Speed Constant, Speed Linear, Speed Log, Speed PotentiallyInfinite, System.Int16 value__

Method overview

int CompareTo(object target), bool Equals(object obj), void Finalize(), int GetHashCode(), System.Type GetType(), System.TypeCode GetTypeCode(), object MemberwiseClone(), string ToString(), string ToString(string format, System.IFormatProvider provider), string ToString(System.IFormatProvider provider), string ToString(string format)

Field details

System.Int16 value__
SSpeed PotentiallyInfinite Counting the collection with the Count property may not return (for a synthetic and potentially infinite collection).
SSpeed Linear Lookup operations like Contains(T item) or the Count property may take time O(n), where n is the size of the collection.
SSpeed Log Lookup operations like Contains(T item) or the Count property takes time O(log n), where n is the size of the collection.
SSpeed Constant Lookup operations like Contains(T item) or the Count property takes time O(1), where n is the size of the collection.

Method details

bool Equals(object obj) Inherited from System.Enum: bool Equals(object obj)
int GetHashCode() Inherited from System.Enum: int GetHashCode()
string ToString() Inherited from System.Enum: string ToString()
string ToString(string format, System.IFormatProvider provider) Inherited from System.Enum: string ToString(string format, System.IFormatProvider provider)
int CompareTo(object target) Inherited from System.Enum: int CompareTo(object target)
string ToString(System.IFormatProvider provider) Inherited from System.Enum: string ToString(System.IFormatProvider provider)
System.TypeCode GetTypeCode() Inherited from System.Enum: System.TypeCode GetTypeCode()
Nstring ToString(string format) Inherited from System.Enum: string ToString(string format)
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
Pvoid Finalize() Inherited from object: void Finalize()

Value Type HashSet<T>.Feature

Enum class to assist printing of compilation alternatives.

Implements

System.IComparable, System.IFormattable, System.IConvertible

Field overview

HashSet<T>.Feature Chaining, HashSet<T>.Feature Dummy, HashSet<T>.Feature InterHasher, HashSet<T>.Feature LinearProbing, HashSet<T>.Feature RandomInterHasher, HashSet<T>.Feature RefTypeBucket, HashSet<T>.Feature ShrinkTable, System.Int16 value__, HashSet<T>.Feature ValueTypeBucket

Method overview

int CompareTo(object target), bool Equals(object obj), void Finalize(), int GetHashCode(), System.Type GetType(), System.TypeCode GetTypeCode(), object MemberwiseClone(), string ToString(), string ToString(string format, System.IFormatProvider provider), string ToString(System.IFormatProvider provider), string ToString(string format)

Field details

System.Int16 value__
SHashSet<T>.Feature Dummy Nothing
SHashSet<T>.Feature RefTypeBucket Buckets are of reference type
SHashSet<T>.Feature ValueTypeBucket Primary buckets are of value type
SHashSet<T>.Feature LinearProbing Using linear probing to resolve index clashes
SHashSet<T>.Feature ShrinkTable Shrink table when very sparsely filled
SHashSet<T>.Feature Chaining Use chaining to resolve index clashes
SHashSet<T>.Feature InterHasher Use hash function on item hash code
SHashSet<T>.Feature RandomInterHasher Use a universal family of hash functions on item hash code

Method details

bool Equals(object obj) Inherited from System.Enum: bool Equals(object obj)
int GetHashCode() Inherited from System.Enum: int GetHashCode()
string ToString() Inherited from System.Enum: string ToString()
string ToString(string format, System.IFormatProvider provider) Inherited from System.Enum: string ToString(string format, System.IFormatProvider provider)
int CompareTo(object target) Inherited from System.Enum: int CompareTo(object target)
string ToString(System.IFormatProvider provider) Inherited from System.Enum: string ToString(System.IFormatProvider provider)
System.TypeCode GetTypeCode() Inherited from System.Enum: System.TypeCode GetTypeCode()
Nstring ToString(string format) Inherited from System.Enum: string ToString(string format)
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
Pvoid Finalize() Inherited from object: void Finalize()

Value Type TreeSet<T>.Feature

A debugging aid for making the selected compilation alternatives available to the user. (To be removed when selection is finally fixed for production version).

Implements

System.IComparable, System.IFormattable, System.IConvertible

Field overview

TreeSet<T>.Feature Dummy, TreeSet<T>.Feature Heights, TreeSet<T>.Feature NodeCopyPersistence, TreeSet<T>.Feature Ranks, TreeSet<T>.Feature Sizes, TreeSet<T>.Feature Traceid, System.Int16 value__

Method overview

int CompareTo(object target), bool Equals(object obj), void Finalize(), int GetHashCode(), System.Type GetType(), System.TypeCode GetTypeCode(), object MemberwiseClone(), string ToString(), string ToString(string format, System.IFormatProvider provider), string ToString(System.IFormatProvider provider), string ToString(string format)

Field details

System.Int16 value__
STreeSet<T>.Feature Dummy Nothing
STreeSet<T>.Feature NodeCopyPersistence Node copy persistence as explained in Tarjan1
STreeSet<T>.Feature Sizes Maintain sub tree sizes
STreeSet<T>.Feature Heights Maintain precise node heights
STreeSet<T>.Feature Ranks Maintain node ranks (~ black height)
STreeSet<T>.Feature Traceid Maintain unique ids on tree nodes.

Method details

bool Equals(object obj) Inherited from System.Enum: bool Equals(object obj)
int GetHashCode() Inherited from System.Enum: int GetHashCode()
string ToString() Inherited from System.Enum: string ToString()
string ToString(string format, System.IFormatProvider provider) Inherited from System.Enum: string ToString(string format, System.IFormatProvider provider)
int CompareTo(object target) Inherited from System.Enum: int CompareTo(object target)
string ToString(System.IFormatProvider provider) Inherited from System.Enum: string ToString(System.IFormatProvider provider)
System.TypeCode GetTypeCode() Inherited from System.Enum: System.TypeCode GetTypeCode()
Nstring ToString(string format) Inherited from System.Enum: string ToString(string format)
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
Pvoid Finalize() Inherited from object: void Finalize()

Value Type KeyValuePair<K,V>

An entry in a dictionary from K to V.

Field overview

K key, V value

Constructor overview

KeyValuePair<K,V>(K k, V v), KeyValuePair<K,V>(K k)

Method overview

bool Equals(object obj), void Finalize(), int GetHashCode(), System.Type GetType(), object MemberwiseClone(), string ToString()

Field details

K key The key field of the entry
V value The value field of the entry

Constructor details

KeyValuePair<K,V>(K k, V v) Create an entry with specified key and value
k: The key
v: The value
KeyValuePair<K,V>(K k) Create an entry with a specified key. The value is undefined.
k: The key

Method details

string ToString() Pretty print an entry
Returns: (key, value)
bool Equals(object obj) Check equality of entries
Returns: True if obj is an entry of the same type and has the same key
obj: The other object
int GetHashCode() Get the hash code of the key.
Returns: The hash code
NSystem.Type GetType() Inherited from object: System.Type GetType()
NPobject MemberwiseClone() Inherited from object: object MemberwiseClone()
Pvoid Finalize() Inherited from object: void Finalize()

Delegate Applier<T>

A generic delegate that when invoked performs some operation on it T argument.

Delegate Mapper<T,V>

A generic delegate whose invocation constitutes a map from T to V.

Delegate Filter<T>

A generic delegate that when invoked on a T item returns a boolean value -- i.e. a T predicate.