Table of Contents

Interface IReadOnlyMultiDictionary<TKey, TValue>

Namespace
LfrlAnvil.Collections
Assembly
LfrlAnvil.Collections.dll

Represents a generic read-only collection of (key, value-range) pairs.

public interface IReadOnlyMultiDictionary<TKey, TValue> : IReadOnlyDictionary<TKey, IReadOnlyList<TValue>>, IReadOnlyCollection<KeyValuePair<TKey, IReadOnlyList<TValue>>>, IEnumerable<KeyValuePair<TKey, IReadOnlyList<TValue>>>, ILookup<TKey, TValue>, IEnumerable<IGrouping<TKey, TValue>>, IEnumerable where TKey : notnull

Type Parameters

TKey

Key type.

TValue

Value type.

Inherited Members
Extension Methods

Properties

Comparer

Key equality comparer.

IEqualityComparer<TKey> Comparer { get; }

Property Value

IEqualityComparer<TKey>

Count

Gets the number of elements in the collection.

int Count { get; }

Property Value

int

The number of elements in the collection.

this[TKey]

Gets the element that has the specified key in the read-only dictionary.

IReadOnlyList<TValue> this[TKey key] { get; }

Parameters

key TKey

The key to locate.

Property Value

IReadOnlyList<TValue>

The element that has the specified key in the read-only dictionary.

Exceptions

ArgumentNullException

key is null.

KeyNotFoundException

The property is retrieved and key is not found.

Keys

Gets an enumerable collection that contains the keys in the read-only dictionary.

IReadOnlyCollection<TKey> Keys { get; }

Property Value

IReadOnlyCollection<TKey>

An enumerable collection that contains the keys in the read-only dictionary.

Values

Gets an enumerable collection that contains the values in the read-only dictionary.

IReadOnlyCollection<IReadOnlyList<TValue>> Values { get; }

Property Value

IReadOnlyCollection<IReadOnlyList<TValue>>

An enumerable collection that contains the values in the read-only dictionary.

Methods

GetCount(TKey)

Returns the number of elements associated with the provided key.

[Pure]
int GetCount(TKey key)

Parameters

key TKey

Key to check.

Returns

int

Number of elements associated with the provided key.

GetEnumerator()

Returns an enumerator that iterates through the collection.

[Pure]
IEnumerator<KeyValuePair<TKey, IReadOnlyList<TValue>>> GetEnumerator()

Returns

IEnumerator<KeyValuePair<TKey, IReadOnlyList<TValue>>>

An enumerator that can be used to iterate through the collection.