Class GuardedDictionary<K,V>

A read-only wrapper for a dictionary. Suitable for wrapping a HashDictionary. HashDictionary<K,V>

Implements

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

Bases

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

Base of

GuardedSortedDictionary<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>> ,
ContainsSpeed ,
Count, Inherited from GuardedCollectionValue<KeyValuePair<K,V>> ,
CountSpeed, Inherited from GuardedCollectionValue<KeyValuePair<K,V>> ,
EqualityComparer ,
Fun ,
IsEmpty, Inherited from GuardedCollectionValue<KeyValuePair<K,V>> ,
IsReadOnly ,
this[K key] ,
Keys ,
ListenableEvents, Inherited from GuardedCollectionValue<KeyValuePair<K,V>> ,
Values

Constructor overview

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

Method overview

Add(K key, V val) ,
AddAll<L,W>(System.Collections.Generic.IEnumerable<KeyValuePair<L,W>> 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() ,
Choose(), Inherited from GuardedCollectionValue<KeyValuePair<K,V>> ,
Clear() ,
Clone() ,
Contains(K key) ,
ContainsAll<H>(System.Collections.Generic.IEnumerable<H> keys) ,
CopyTo(KeyValuePair<K,V>[] a, int i), Inherited from GuardedCollectionValue<KeyValuePair<K,V>> ,
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) ,
Find(ref K key, out V val) ,
Find(Fun<KeyValuePair<K,V>,bool> filter, out KeyValuePair<K,V> item), Inherited from GuardedCollectionValue<KeyValuePair<K,V>> ,
FindOrAdd(K key, ref V val) ,
GetEnumerator(), Inherited from GuardedEnumerable<KeyValuePair<K,V>> ,
GetHashCode(), Inherited from object ,
GetType(), Inherited from object ,
MemberwiseClone(), Inherited from object ,
Remove(K key) ,
Remove(K key, out V val) ,
Show(System.Text.StringBuilder stringbuilder, ref int rest, System.IFormatProvider formatProvider), Inherited from GuardedCollectionValue<KeyValuePair<K,V>> ,
ToArray(), Inherited from GuardedCollectionValue<KeyValuePair<K,V>> ,
ToString(string format, System.IFormatProvider formatProvider), Inherited from GuardedCollectionValue<KeyValuePair<K,V>> ,
ToString(), Inherited from object ,
Update(K key, V val) ,
Update(K key, V val, out V oldval) ,
UpdateOrAdd(K key, V val) ,
UpdateOrAdd(K key, V val, out V oldval)

Property details

F Speed ContainsSpeedAccess: Read-Only

Value:

F System.Collections.Generic.IEqualityComparer<K> EqualityComparerAccess: Read-Only

Value:

Fun<K,V> FunAccess: Read-Only
F bool IsReadOnlyAccess: Read-Only

Value:True

(This is a read-only wrapper)
F V this[K key]Access: Read-Write

Value:Get the value corresponding to a key in the wrapped dictionary

Throws
ReadOnlyCollectionException since this is a read-only wrappper if used as a setter
F ICollectionValue<K> KeysAccess: Read-Only

Value:The collection of keys of the wrapped dictionary

F ICollectionValue<V> ValuesAccess: Read-Only

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
Parameters:
dict:the dictionary

Method details

F void Add(K key, V val)
Throws
ReadOnlyCollectionException since this is a read-only wrappper
Parameters:
key:
val:
F void AddAll<L,W>(System.Collections.Generic.IEnumerable<KeyValuePair<L,W>> items)
Throws
ReadOnlyCollectionException since this is a read-only wrappper
Parameters:
items:
F bool Check() Check the internal consistency of the wrapped dictionary
Returns:True if check passed
F void Clear()
Throws
ReadOnlyCollectionException since this is a read-only wrappper
object Clone()
Returns:
F bool Contains(K key) Check if the wrapped dictionary contains a specific key
Returns:True if it does
Parameters:
key:The key
F bool ContainsAll<H>(System.Collections.Generic.IEnumerable<H> keys)
Returns:
Parameters:
keys:
F bool Find(K key, out V val) Search for a key in the wrapped dictionary, reporting the value if found
Returns:True if found
Parameters:
key:The key
val:On exit: the value if found
F bool Find(ref K key, out V val) Search for a key in the wrapped dictionary, reporting the value if found
Returns:True if found
Parameters:
key:The key
val:On exit: the value if found
F bool FindOrAdd(K key, ref V val)
Throws
ReadOnlyCollectionException since this is a read-only wrappper
Returns:
Parameters:
key:
val:
F bool Remove(K key)
Throws
ReadOnlyCollectionException since this is a read-only wrappper
Returns:
Parameters:
key:
F bool Remove(K key, out V val)
Throws
ReadOnlyCollectionException since this is a read-only wrappper
Returns:
Parameters:
key:
val:
F bool Update(K key, V val)
Throws
ReadOnlyCollectionException since this is a read-only wrappper
Returns:
Parameters:
key:
val:
F bool Update(K key, V val, out V oldval)
Throws
ReadOnlyCollectionException since this is a read-only wrappper
Returns:
Parameters:
key:
val:
oldval:
F bool UpdateOrAdd(K key, V val)
Throws
ReadOnlyCollectionException since this is a read-only wrappper
Returns:
Parameters:
key:
val:
F bool UpdateOrAdd(K key, V val, out V oldval)
Throws
ReadOnlyCollectionException since this is a read-only wrappper
Returns:
Parameters:
key:
val:
oldval: