Class DictionaryList<K, T>
Dictionary of IEnumerable<T> of key type K.
public class DictionaryList<K, T> : IDictionaryList<K, T>, IReadOnlyDictList<K, T>, IEnumerable<KeyValuePair<K, IEnumerable<T>>>, IEnumerable where K : notnull
Type Parameters
KT
- Inheritance
-
DictionaryList<K, T>
- Implements
-
IDictionaryList<K, T>IReadOnlyDictList<K, T>
- Inherited Members
- Extension Methods
Constructors
DictionaryList()
Default ctor.
public DictionaryList()
DictionaryList(Func<K, IEnumerable<T>>, IEqualityComparer<K>?)
Default ctor.
public DictionaryList(Func<K, IEnumerable<T>> defaultValue, IEqualityComparer<K>? comp = null)
Parameters
defaultValueFunc<K, IEnumerable<T>>compIEqualityComparer<K>
Properties
Count
Count of all values (of all enumerations).
public int Count { get; }
Property Value
IsReadOnly
public bool IsReadOnly { get; }
Property Value
this[K]
The list (enumation) associated with key.
public IEnumerable<T> this[K key] { get; set; }
Parameters
keyK
Property Value
- IEnumerable<T>
Keys
Read-only collection of keys.
public IEnumerable<K> Keys { get; }
Property Value
- IEnumerable<K>
Values
Read-only collection of all values (of all enumerations).
public IEnumerable<T> Values { get; }
Property Value
- IEnumerable<T>
Methods
Add(KeyValuePair<K, IEnumerable<T>>)
Add pair.
public void Add(KeyValuePair<K, IEnumerable<T>> pair)
Parameters
pairKeyValuePair<K, IEnumerable<T>>
Add(K, T)
Add value to enumerable assocoated with key.
public void Add(K key, T value)
Parameters
keyKvalueT
AddRange(K, IEnumerable<T>)
Add all values to enumerable assocoated with key.
public void AddRange(K key, IEnumerable<T> values)
Parameters
keyKvaluesIEnumerable<T>
Clear()
Clear.
public void Clear()
Contains(T)
Checks whether item is contained in any enumerable.
public bool Contains(T item)
Parameters
itemT
Returns
ContainsKey(K)
Checks whether key is assocoated with an enumerable.
public bool ContainsKey(K key)
Parameters
keyK
Returns
GetEnumerator()
public IEnumerator<KeyValuePair<K, IEnumerable<T>>> GetEnumerator()
Returns
- IEnumerator<KeyValuePair<K, IEnumerable<T>>>
Remove(K)
Returns true if enumerable assocoated with key was removed.
public bool Remove(K key)
Parameters
keyK
Returns
Remove(K, T)
Returns true if value was rmoved from enumerable assocoated with key.
public bool Remove(K key, T value)
Parameters
keyKvalueT
Returns
TryGetValue(K, out IEnumerable<T>)
Try get value by key.
public bool TryGetValue(K key, out IEnumerable<T> value)
Parameters
keyKvalueIEnumerable<T>
Returns
Explicit Interface Implementations
IEnumerable.GetEnumerator()
IEnumerator IEnumerable.GetEnumerator()
Returns
IReadOnlyDictList<K, T>.IsReadOnly
bool IReadOnlyDictList<K, T>.IsReadOnly { get; }