Class GuardedSortedDictionary<K,V>

A read-only wrapper for a sorted dictionary. Suitable for wrapping a Dictionary.

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, GuardedEnumerable<KeyValuePair<K,V>>, GuardedCollectionValue<KeyValuePair<K,V>>, GuardedDictionary<K,V>

Event overview

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

Property overview

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

Constructor overview

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

Method overview

Add(K key, V val), Inherited from GuardedDictionary<K,V> ,
AddAll<L,W>(System.Collections.Generic.IEnumerable<KeyValuePair<L,W>> items), Inherited from GuardedDictionary<K,V> ,
AddSorted(System.Collections.Generic.IEnumerable<KeyValuePair<K,V>> items) ,
All(Fun<KeyValuePair<K,V>,bool> filter), Inherited from GuardedCollectionValue<KeyValuePair<K,V>> ,
Apply(Act<KeyValuePair<K,V>> a), Inherited from GuardedCollectionValue<KeyValuePair<K,V>> ,
Check(), Inherited from GuardedDictionary<K,V> ,
Choose(), Inherited from GuardedCollectionValue<KeyValuePair<K,V>> ,
Clear(), Inherited from GuardedDictionary<K,V> ,
Clone(), Inherited from GuardedDictionary<K,V> ,
Contains(K key), Inherited from GuardedDictionary<K,V> ,
ContainsAll<H>(System.Collections.Generic.IEnumerable<H> keys), Inherited from GuardedDictionary<K,V> ,
CopyTo(KeyValuePair<K,V>[] a, int i), Inherited from GuardedCollectionValue<KeyValuePair<K,V>> ,
Cut(System.IComparable<K> c, 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> filter), Inherited from GuardedCollectionValue<KeyValuePair<K,V>> ,
Filter(Fun<KeyValuePair<K,V>,bool> filter), Inherited from GuardedCollectionValue<KeyValuePair<K,V>> ,
Finalize(), Inherited from object ,
Find(K key, out V val), Inherited from GuardedDictionary<K,V> ,
Find(ref K key, out V val), Inherited from GuardedDictionary<K,V> ,
Find(Fun<KeyValuePair<K,V>,bool> filter, out KeyValuePair<K,V> item), Inherited from GuardedCollectionValue<KeyValuePair<K,V>> ,
FindMax() ,
FindMin() ,
FindOrAdd(K key, ref V val), Inherited from GuardedDictionary<K,V> ,
GetEnumerator(), Inherited from GuardedEnumerable<KeyValuePair<K,V>> ,
GetHashCode(), Inherited from object ,
GetType(), Inherited from object ,
MemberwiseClone(), Inherited from object ,
Predecessor(K key) ,
RangeAll() ,
RangeFrom(K bot) ,
RangeFromTo(K bot, K top) ,
RangeTo(K top) ,
Remove(K key), Inherited from GuardedDictionary<K,V> ,
Remove(K key, out V val), Inherited from GuardedDictionary<K,V> ,
RemoveRangeFrom(K low) ,
RemoveRangeFromTo(K low, K hi) ,
RemoveRangeTo(K hi) ,
Show(System.Text.StringBuilder stringbuilder, ref int rest, System.IFormatProvider formatProvider), Inherited from GuardedCollectionValue<KeyValuePair<K,V>> ,
Successor(K key) ,
ToArray(), Inherited from GuardedCollectionValue<KeyValuePair<K,V>> ,
ToString(string format, System.IFormatProvider formatProvider), Inherited from GuardedCollectionValue<KeyValuePair<K,V>> ,
ToString(), Inherited from object ,
TryPredecessor(K key, out KeyValuePair<K,V> res) ,
TrySuccessor(K key, out KeyValuePair<K,V> res) ,
TryWeakPredecessor(K key, out KeyValuePair<K,V> res) ,
TryWeakSuccessor(K key, out KeyValuePair<K,V> res) ,
Update(K key, V val), Inherited from GuardedDictionary<K,V> ,
Update(K key, V val, out V oldval), Inherited from GuardedDictionary<K,V> ,
UpdateOrAdd(K key, V val), Inherited from GuardedDictionary<K,V> ,
UpdateOrAdd(K key, V val, out V oldval), Inherited from GuardedDictionary<K,V> ,
WeakPredecessor(K key) ,
WeakSuccessor(K key)

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

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

Method details

F void AddSorted(System.Collections.Generic.IEnumerable<KeyValuePair<K,V>> items)
Throws
ReadOnlyCollectionException since this is a read-only wrappper
Parameters:
items:
F bool Cut(System.IComparable<K> c, out KeyValuePair<K,V> lowEntry, out bool lowIsValid, out KeyValuePair<K,V> highEntry, out bool highIsValid)
Returns:
Parameters:
c:
lowEntry:
lowIsValid:
highEntry:
highIsValid:
F KeyValuePair<K,V> DeleteMax()
Throws
ReadOnlyCollectionException since this is a read-only wrappper
Returns:
F KeyValuePair<K,V> DeleteMin()
Throws
ReadOnlyCollectionException since this is a read-only wrappper
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 wrapped dictionary whose key is the predecessor of a specified key.
Throws
NoSuchItemException if no such entry exists
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 low)
Throws
ReadOnlyCollectionException since this is a read-only wrappper
Parameters:
low:
F void RemoveRangeFromTo(K low, K hi)
Throws
ReadOnlyCollectionException since this is a read-only wrappper
Parameters:
low:
hi:
F void RemoveRangeTo(K hi)
Throws
ReadOnlyCollectionException since this is a read-only wrappper
Parameters:
hi:
F KeyValuePair<K,V> Successor(K key) Get the entry in the wrapped dictionary whose key is the successor of a specified key.
Throws
NoSuchItemException if no such entry exists
Returns:The entry
Parameters:
key:The key
F bool TryPredecessor(K key, out KeyValuePair<K,V> res) Find the entry in the dictionary whose key is the predecessor of the specified key.
Returns:True if key has a predecessor
Parameters:
key:The key
res:The predecessor, if any
F bool TrySuccessor(K key, out KeyValuePair<K,V> res) Find the entry in the dictionary whose key is the successor of the specified key.
Returns:True if the key has a successor
Parameters:
key:The key
res:The successor, if any
F bool TryWeakPredecessor(K key, out KeyValuePair<K,V> res) Find the entry in the dictionary whose key is the weak predecessor of the specified key.
Returns:True if key has a weak predecessor
Parameters:
key:The key
res:The predecessor, if any
F bool TryWeakSuccessor(K key, out KeyValuePair<K,V> res) Find the entry in the dictionary whose key is the weak successor of the specified key.
Returns:True if the key has a weak successor
Parameters:
key:The key
res:The weak successor, if any
F KeyValuePair<K,V> WeakPredecessor(K key) Get the entry in the wrapped dictionary whose key is the weak predecessor of a specified key.
Throws
NoSuchItemException if no such entry exists
Returns:The entry
Parameters:
key:The key
F KeyValuePair<K,V> WeakSuccessor(K key) Get the entry in the wrapped dictionary whose key is the weak successor of a specified key.
Throws
NoSuchItemException if no such entry exists
Returns:The entry
Parameters:
key:The key