MultiMapK, V Class

Custom implementation of a multi map because C# does not offer one by default.

Definition

Namespace: Karamba.Utilities
Assembly: KarambaCommon (in KarambaCommon.dll) Version: 3.0.8.0+eb23a7103f0eca0b6d808121e15fec6899194e15
C#
[SerializableAttribute]
public class MultiMap<K, V> : ISerializable, 
	ICollection<KeyValuePair<K, List<V>>>, IEnumerable<KeyValuePair<K, List<V>>>, 
	IEnumerable
Inheritance
Object    MultiMapK, V
Implements
ICollectionKeyValuePairK, ListV, IEnumerableKeyValuePairK, ListV, IEnumerable, ISerializable

Type Parameters

K
type of key.
V
type of values.

Constructors

MultiMapK, V Initializes a new instance of the MultiMapK, V class. the constructor.
MultiMapK, V(IDictionaryK, IEnumerableV) Initializes a new instance of the MultiMapK, V class.
MultiMapK, V(IDictionaryK, ListV) Initializes a new instance of the MultiMapK, V class.
MultiMapK, V(IEnumerableKeyValuePairK, V) Initializes a new instance of the MultiMapK, V class.
MultiMapK, V(ILookupK, V) Initializes a new instance of the MultiMapK, V class
MultiMapK, V(MultiMapK, V) Initializes a new instance of the MultiMapK, V class. Copy constructor for mult-imaps.
MultiMapK, V(SerializationInfo, StreamingContext) Initializes a new instance of the MultiMapK, V class. Deserialize BuilderElementStraightLine.

Properties

AsDictionary Gets the equivalent IReadOnlyDictionary.
Count Gets the number of elements contained in the ICollectionT.
CountKeys Gets the number of keys in the MultiMap.
CountValues Gets the number of values in the MultiMap.
IsReadOnly Gets a value indicating whether the ICollectionT is read-only.
Item return all values corresponding to a given key.
Keys Gets the keys of the multi-map.

Methods

Add(KeyValuePairK, ListV) add an element to the map.
Add(K) add an key to the map but no values which results in an empty list.
Add(K, V) add an element to the map.
Add(K, ListV) add a list of identifiers to the map.
AddUnique add an element to the map if not already present.
Clear Removes all items from the ICollectionT.
Contains Determines whether the ICollectionT contains a specific value.
ContainsKey Checks whether the MultiMap contains a specific key.
CopyTo Copies the elements of the ICollectionT to an Array, starting at a particular Array index.
Equals Determines whether the specified object is equal to the current object.
(Inherited from Object)
Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetEnumerator Get Enumerator for iterating over the dictionary key-value-pairs.
GetHashCode Serves as the default hash function.
(Inherited from Object)
GetObjectData Serialize BuilderElementStraightLine.
GetType Gets the Type of the current instance.
(Inherited from Object)
KeysWithZeroItems Get the list of keys with entries that do not contain items.
MemberwiseClone Creates a shallow copy of the current Object.
(Inherited from Object)
Remove Removes the first occurrence of a specific object from the ICollectionT.
ToLookup Convert MultiMap to Lookup.
ToString Returns a string that represents the current object.
(Inherited from Object)
TryGetValue Tries to find a key in the MultiMap.

Extension Methods

ContainerType test if object is (a container like) a list or an array.
(Defined by MiniUtil)
SelectWhereKeyValuePairK, ListV, TResult Project each element of a sequence into a new form if they fulfill a given condition.
(Defined by EnumerableExtensions)
SplitKeyValuePairK, ListV Splits the source sequence by a max distance and optional minimum number of intervals applied to a sequence of double.
(Defined by EnumerableExtensions)
ToHashsetKeyValuePairK, ListV Creates a HashSetT from an IEnumerableT.
(Defined by EnumerableExtensions)
ToPairKeyValuePairK, ListV Convert am array with (at least) two elements in a pair (2-tuple).
(Defined by MiniUtil)
ToTupleKeyValuePairK, ListV Convert am array/list/... with (at least) n elements in a n-tuple.
(Defined by MiniUtil)
WithIndexKeyValuePairK, ListV Converts a list to a list with tuples of value and index.
(Defined by MiniUtil)
WithOrdinalityKeyValuePairK, ListV Converts a list to a list with tuples of value and index.
(Defined by MiniUtil)
ZipThreeKeyValuePairK, ListV, T2, T3, TResult Apply a given function with three input arguments to each element of three lists.
(Defined by Utils)

See Also