Struct CollectionDictionary<T, U>.Lookup
A read-only wrapper that implements ILookup<TKey, TElement> for a CollectionDictionary<T, U>.
public readonly struct CollectionDictionary<T, U>.Lookup : ILookup<T, U>, IEnumerable<IGrouping<T, U>>, IEnumerable
- Implements
-
ILookup<T, U>IEnumerable<IGrouping<T, U>>
- Inherited Members
Constructors
Lookup(CollectionDictionary<T, U>)
A read-only wrapper that implements ILookup<TKey, TElement> for a CollectionDictionary<T, U>.
public Lookup(CollectionDictionary<T, U> parent)
Parameters
parentCollectionDictionary<T, U>
Properties
Count
Gets the number of key-collection pairs in the lookup.
public int Count { get; }
Property Value
this[T]
Gets the collection of values associated with the specified key.
public IEnumerable<U> this[T key] { get; }
Parameters
keyTThe key of the collection to get.
Property Value
- IEnumerable<U>
The collection of values associated with the key.
Methods
Contains(T)
Determines whether the lookup contains a specified key.
public bool Contains(T key)
Parameters
keyTThe key to locate in the lookup.
Returns
- bool
true if the lookup contains an element with the specified key; otherwise, false.
GetEnumerator()
Returns an enumerator that iterates through the groupings in the lookup.
public IEnumerator<IGrouping<T, U>> GetEnumerator()
Returns
- IEnumerator<IGrouping<T, U>>
An enumerator for the lookup.