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
K
T
- 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
defaultValue
Func<K, IEnumerable<T>>comp
IEqualityComparer<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
key
K
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
pair
KeyValuePair<K, IEnumerable<T>>
Add(K, T)
Add value
to enumerable assocoated with key
.
public void Add(K key, T value)
Parameters
key
Kvalue
T
AddRange(K, IEnumerable<T>)
Add all values
to enumerable assocoated with key
.
public void AddRange(K key, IEnumerable<T> values)
Parameters
key
Kvalues
IEnumerable<T>
Clear()
Clear.
public void Clear()
Contains(T)
Checks whether item
is contained in any enumerable.
public bool Contains(T item)
Parameters
item
T
Returns
ContainsKey(K)
Checks whether key
is assocoated with an enumerable.
public bool ContainsKey(K key)
Parameters
key
K
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
key
K
Returns
Remove(K, T)
Returns true if value
was rmoved from enumerable assocoated with key
.
public bool Remove(K key, T value)
Parameters
key
Kvalue
T
Returns
TryGetValue(K, out IEnumerable<T>)
Try get value
by key
.
public bool TryGetValue(K key, out IEnumerable<T> value)
Parameters
key
Kvalue
IEnumerable<T>
Returns
Explicit Interface Implementations
IEnumerable.GetEnumerator()
IEnumerator IEnumerable.GetEnumerator()
Returns
IReadOnlyDictList<K, T>.IsReadOnly
bool IReadOnlyDictList<K, T>.IsReadOnly { get; }