Class Multimap<TKey, TValue>
A dictionary in which one key has many associated values.
Inheritance
Namespace: Telerik.CallHome.OpenAPI.Client
Assembly: Telerik.Windows.Controls.dll
Syntax
public class Multimap<TKey, TValue> : Object, IDictionary<TKey, IList<TValue>>, ICollection<KeyValuePair<TKey, IList<TValue>>>, IEnumerable<KeyValuePair<TKey, IList<TValue>>>, IEnumerable
Type Parameters
TKey
The type of the key |
TValue
The type of the value associated with the key. |
Constructors
Multimap()
Empty Constructor.
Declaration
public Multimap()
Multimap(IEqualityComparer<TKey>)
Constructor with comparer.
Declaration
public Multimap(IEqualityComparer<TKey> comparer)
Parameters
System.
|
Properties
Count
Gets the number of items contained in the Multimap.
Declaration
public int Count { get; }
Property Value
System.
|
IsReadOnly
Gets a value indicating whether the Multimap is read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
System.
|
Item[TKey]
Gets or sets the item with the specified key.
Declaration
public IList<TValue> this[TKey key] { get; set; }
Parameters
TKey
key
The key of the item to get or set. |
Property Value
System. The value of the specified key. |
Keys
Gets a System.Collections.Generic.ICollection containing the keys of the Multimap.
Declaration
public ICollection<TKey> Keys { get; }
Property Value
System.
|
Values
Gets a System.Collections.Generic.ICollection containing the values of the Multimap.
Declaration
public ICollection<IList<TValue>> Values { get; }
Property Value
System.
|
Methods
Add(TKey, TValue)
Adds an item with the provided key and value to the Multimap.
Declaration
public void Add(TKey key, TValue value)
Parameters
TKey
key
The object to use as the key of the item to add. |
TValue
value
The object to use as the value of the item to add. |
Exceptions
System. Thrown when couldn't add value to Multimap. |
Add(TKey, IList<TValue>)
Adds an item with the provided key and value to the Multimap.
Declaration
public void Add(TKey key, IList<TValue> value)
Parameters
TKey
key
The object to use as the key of the item to add. |
System. The object to use as the value of the item to add. |
Exceptions
System. Thrown when couldn't add the value to Multimap. |
Add(KeyValuePair<TKey, IList<TValue>>)
Add values to Multimap
Declaration
public void Add(KeyValuePair<TKey, IList<TValue>> item)
Parameters
System. Key value pair |
Add(Multimap<TKey, TValue>)
Add Multimap to Multimap
Declaration
public void Add(Multimap<TKey, TValue> multimap)
Parameters
Multimap<TKey, TValue>
multimap
Multimap |
Clear()
Clear Multimap
Declaration
public void Clear()
Contains(KeyValuePair<TKey, IList<TValue>>)
Determines whether Multimap contains the specified item.
Declaration
public bool Contains(KeyValuePair<TKey, IList<TValue>> item)
Parameters
System. Key value pair |
Returns
System. true if the Multimap contains the item; otherwise, false. |
Exceptions
System. Method needs to be implemented |
ContainsKey(TKey)
Determines whether the Multimap contains an item with the specified key.
Declaration
public bool ContainsKey(TKey key)
Parameters
TKey
key
The key to locate in the Multimap. |
Returns
System. true if the Multimap contains an item with the key; otherwise, false. |
CopyTo(Array, Int32)
Copy the items of the Multimap to an System.Array, starting at a particular System.Array index.
Declaration
public void CopyTo(Array array, int index)
Parameters
System. The one-dimensional System.Array that is the destination of the items copied from Multimap. The System.Array must have zero-based indexing. |
System. The zero-based index in array at which copying begins. |
CopyTo(KeyValuePair<TKey, IList<TValue>>[], Int32)
Copy items of the Multimap to an array, starting at a particular array index.
Declaration
public void CopyTo(KeyValuePair<TKey, IList<TValue>>[] array, int arrayIndex)
Parameters
System. The array that is the destination of the items copied from Multimap. The array must have zero-based indexing. |
System. The zero-based index in array at which copying begins. |
Exceptions
System. Method needs to be implemented |
GetEnumerator()
To get the enumerator.
Declaration
public IEnumerator<KeyValuePair<TKey, IList<TValue>>> GetEnumerator()
Returns
System. Enumerator |
Remove(TKey)
Removes item with the specified key from the Multimap.
Declaration
public bool Remove(TKey key)
Parameters
TKey
key
The key to locate in the Multimap. |
Returns
System. true if the item is successfully removed; otherwise, false. |
Remove(KeyValuePair<TKey, IList<TValue>>)
Removes the specified item from the Multimap.
Declaration
public bool Remove(KeyValuePair<TKey, IList<TValue>> item)
Parameters
System. Key value pair |
Returns
System. true if the item is successfully removed; otherwise, false. |
Exceptions
System. Method needs to be implemented |
TryGetValue(TKey, out IList<TValue>)
Gets the value associated with the specified key.
Declaration
public bool TryGetValue(TKey key, out IList<TValue> value)
Parameters
TKey
key
The key whose value to get. |
System. When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized. |
Returns
System. true if the object that implements Multimap contains an item with the specified key; otherwise, false. |