Class SortedDictionaryBase<K,V>

A base class for implementing a sorted dictionary based on a sorted set collection implementation. See the source code for TreeDictionary<K,V> for an example

Implements

System.Collections.Generic.IEnumerable<KeyValuePair<K,V>>, System.Collections.IEnumerable, System.IFormattable, System.ICloneable, ICollectionValue<KeyValuePair<K,V>>, IDictionary<K,V>, IShowable, ISortedDictionary<K,V>

Bases

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

Base of

TreeDictionary<K,V>

Field overview

pairs, Inherited from DictionaryBase<K,V> ,
sortedpairs

Event overview

CollectionChanged, Inherited from DictionaryBase<K,V> ,
CollectionCleared, Inherited from DictionaryBase<K,V> ,
ItemInserted, Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
ItemRemovedAt, Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
ItemsAdded, Inherited from DictionaryBase<K,V> ,
ItemsRemoved, Inherited from DictionaryBase<K,V>

Property overview

ActiveEvents, Inherited from DictionaryBase<K,V> ,
Comparer ,
ContainsSpeed, Inherited from DictionaryBase<K,V> ,
Count, Inherited from DictionaryBase<K,V> ,
CountSpeed, Inherited from DictionaryBase<K,V> ,
EqualityComparer, Inherited from DictionaryBase<K,V> ,
Fun, Inherited from DictionaryBase<K,V> ,
IsEmpty, Inherited from DictionaryBase<K,V> ,
IsReadOnly, Inherited from DictionaryBase<K,V> ,
this[K key], Inherited from DictionaryBase<K,V> ,
Keys ,
Keys, Inherited from DictionaryBase<K,V> ,
ListenableEvents, Inherited from DictionaryBase<K,V> ,
Values, Inherited from DictionaryBase<K,V>

Constructor overview

SortedDictionaryBase<K,V>(System.Collections.Generic.IComparer<K> keycomparer, System.Collections.Generic.IEqualityComparer<K> keyequalityComparer)

Method overview

Add(K key, V value), Inherited from DictionaryBase<K,V> ,
AddAll<L,W>(System.Collections.Generic.IEnumerable<KeyValuePair<L,W>> entries), Inherited from DictionaryBase<K,V> ,
AddSorted(System.Collections.Generic.IEnumerable<KeyValuePair<K,V>> items) ,
All(Fun<KeyValuePair<K,V>,bool> predicate), Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
Apply(Act<KeyValuePair<K,V>> action), Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
Check(), Inherited from DictionaryBase<K,V> ,
Choose(), Inherited from DictionaryBase<K,V> ,
Clear(), Inherited from DictionaryBase<K,V> ,
Clone(), Inherited from DictionaryBase<K,V> ,
Contains(K key), Inherited from DictionaryBase<K,V> ,
ContainsAll<H>(System.Collections.Generic.IEnumerable<H> keys), Inherited from DictionaryBase<K,V> ,
CopyTo(KeyValuePair<K,V>[] array, int index), Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
Cut(System.IComparable<K> cutter, out KeyValuePair<K,V> lowEntry, out bool lowIsValid, out KeyValuePair<K,V> highEntry, out bool highIsValid) ,
DeleteMax() ,
DeleteMin() ,
Equals(object obj), Inherited from object ,
Exists(Fun<KeyValuePair<K,V>,bool> predicate), Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
Filter(Fun<KeyValuePair<K,V>,bool> predicate), Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
Finalize(), Inherited from object ,
Find(K key, out V value), Inherited from DictionaryBase<K,V> ,
Find(ref K key, out V value), Inherited from DictionaryBase<K,V> ,
Find(Fun<KeyValuePair<K,V>,bool> predicate, out KeyValuePair<K,V> item), Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
FindMax() ,
FindMin() ,
FindOrAdd(K key, ref V value), Inherited from DictionaryBase<K,V> ,
GetEnumerator(), Inherited from DictionaryBase<K,V> ,
GetHashCode(), Inherited from object ,
GetType(), Inherited from object ,
MemberwiseClone(), Inherited from object ,
Predecessor(K key) ,
raiseCollectionChanged(), Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
raiseCollectionCleared(bool full, int count), Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
raiseCollectionCleared(bool full, int count, System.Nullable<int> offset), Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
raiseForAdd(KeyValuePair<K,V> item), Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
raiseForInsert(int i, KeyValuePair<K,V> item), Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
raiseForRemove(KeyValuePair<K,V> item), Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
raiseForRemove(KeyValuePair<K,V> item, int count), Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
raiseForRemoveAll(ICollectionValue<KeyValuePair<K,V>> wasRemoved), Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
raiseForRemoveAt(int index, KeyValuePair<K,V> item), Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
raiseForSetThis(int index, KeyValuePair<K,V> value, KeyValuePair<K,V> item), Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
raiseForUpdate(KeyValuePair<K,V> newitem, KeyValuePair<K,V> olditem), Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
raiseForUpdate(KeyValuePair<K,V> newitem, KeyValuePair<K,V> olditem, int count), Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
raiseItemInserted(KeyValuePair<K,V> item, int index), Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
raiseItemRemovedAt(KeyValuePair<K,V> item, int index), Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
raiseItemsAdded(KeyValuePair<K,V> item, int count), Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
raiseItemsRemoved(KeyValuePair<K,V> item, int count), Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
RangeAll() ,
RangeFrom(K bot) ,
RangeFromTo(K bot, K top) ,
RangeTo(K top) ,
Remove(K key), Inherited from DictionaryBase<K,V> ,
Remove(K key, out V value), Inherited from DictionaryBase<K,V> ,
RemoveRangeFrom(K lowKey) ,
RemoveRangeFromTo(K lowKey, K highKey) ,
RemoveRangeTo(K highKey) ,
Show(System.Text.StringBuilder stringbuilder, ref int rest, System.IFormatProvider formatProvider) ,
Successor(K key) ,
ToArray(), Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
ToString(string format, System.IFormatProvider formatProvider), Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
ToString(), Inherited from CollectionValueBase<KeyValuePair<K,V>> ,
Update(K key, V value), Inherited from DictionaryBase<K,V> ,
Update(K key, V value, out V oldvalue), Inherited from DictionaryBase<K,V> ,
UpdateOrAdd(K key, V value), Inherited from DictionaryBase<K,V> ,
UpdateOrAdd(K key, V value, out V oldvalue), Inherited from DictionaryBase<K,V> ,
WeakPredecessor(K key) ,
WeakSuccessor(K key)

Field details

P ISorted<KeyValuePair<K,V>> sortedpairs

Property details

F System.Collections.Generic.IComparer<K> ComparerAccess: Read-Only

Value:

The key comparer used by this dictionary.
F ISorted<K> KeysAccess: Read-Only

Value:

Constructor details

SortedDictionaryBase<K,V>(System.Collections.Generic.IComparer<K> keycomparer, System.Collections.Generic.IEqualityComparer<K> keyequalityComparer)
Parameters:
keycomparer:
keyequalityComparer:

Method details

F void AddSorted(System.Collections.Generic.IEnumerable<KeyValuePair<K,V>> items)
Parameters:
items:
F bool Cut(System.IComparable<K> cutter, out KeyValuePair<K,V> lowEntry, out bool lowIsValid, out KeyValuePair<K,V> highEntry, out bool highIsValid)
Returns:
Parameters:
cutter:
lowEntry:
lowIsValid:
highEntry:
highIsValid:
F KeyValuePair<K,V> DeleteMax()
Returns:
F KeyValuePair<K,V> DeleteMin()
Returns:
F KeyValuePair<K,V> FindMax()
Returns:
F KeyValuePair<K,V> FindMin()
Returns:
F KeyValuePair<K,V> Predecessor(K key) Get the entry in the dictionary whose key is the predecessor of a specified key.
Throws
NoSuchItemException
Returns:The entry
Parameters:
key:The key
F IDirectedCollectionValue<KeyValuePair<K,V>> RangeAll()
Returns:
F IDirectedEnumerable<KeyValuePair<K,V>> RangeFrom(K bot)
Returns:
Parameters:
bot:
F IDirectedEnumerable<KeyValuePair<K,V>> RangeFromTo(K bot, K top)
Returns:
Parameters:
bot:
top:
F IDirectedEnumerable<KeyValuePair<K,V>> RangeTo(K top)
Returns:
Parameters:
top:
F void RemoveRangeFrom(K lowKey)
Parameters:
lowKey:
F void RemoveRangeFromTo(K lowKey, K highKey)
Parameters:
lowKey:
highKey:
F void RemoveRangeTo(K highKey)
Parameters:
highKey:
bool Show(System.Text.StringBuilder stringbuilder, ref int rest, System.IFormatProvider formatProvider)
Returns:
Parameters:
stringbuilder:
rest:
formatProvider:
F KeyValuePair<K,V> Successor(K key) Get the entry in the dictionary whose key is the successor of a specified key.
Throws
NoSuchItemException
Returns:The entry
Parameters:
key:The key
F KeyValuePair<K,V> WeakPredecessor(K key) Get the entry in the dictionary whose key is the weak predecessor of a specified key.
Throws
NoSuchItemException
Returns:The entry
Parameters:
key:The key
F KeyValuePair<K,V> WeakSuccessor(K key) Get the entry in the dictionary whose key is the weak successor of a specified key.
Throws
NoSuchItemException
Returns:The entry
Parameters:
key:The key