Class NullValueDictionary<TKey, TValue>
This custom IDictionary doesn't throw a KeyNotFoundException while accessing its value by a given key
public class NullValueDictionary<TKey, TValue> : Dictionary<TKey, TValue>, IDictionary, ICollection, IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, ISerializable, IDeserializationCallback, INullValueDictionary<TKey, TValue>, IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable
Type Parameters
TKey
TValue
- Inheritance
-
Dictionary<TKey, TValue>NullValueDictionary<TKey, TValue>
- Implements
-
IReadOnlyDictionary<TKey, TValue>IReadOnlyCollection<KeyValuePair<TKey, TValue>>INullValueDictionary<TKey, TValue>IDictionary<TKey, TValue>ICollection<KeyValuePair<TKey, TValue>>IEnumerable<KeyValuePair<TKey, TValue>>
- Derived
- Inherited Members
Constructors
NullValueDictionary()
public NullValueDictionary()
NullValueDictionary(IDictionary<TKey, TValue>)
public NullValueDictionary(IDictionary<TKey, TValue> dictionary)
Parameters
dictionary
IDictionary<TKey, TValue>
NullValueDictionary(int)
public NullValueDictionary(int capacity)
Parameters
capacity
int
Properties
this[TKey]
public TValue this[TKey key] { get; set; }
Parameters
key
TKey
Property Value
- TValue
Size
public int Size { get; }
Property Value
Methods
Clone()
public INullValueDictionary<TKey, TValue> Clone()
Returns
- INullValueDictionary<TKey, TValue>
GetKeys()
public IList<TKey> GetKeys()
Returns
- IList<TKey>
IsEmpty()
public bool IsEmpty()
Returns
ToOrderedKeys()
public IList<TKey> ToOrderedKeys()
Returns
- IList<TKey>