.NET: ListMap
22 May 2006
A data structure that associates multiple values with a single key.
In .NET, a class that implements IDictionary manages associates between keys and values. A single value can be associated with a given key.
A ListMap (or multimap) is similar to a dictionary, but allows multiple values to be associated with each key.
public interface IListMap<TKey, TValue>
- void Add(TKey key, TValue value);
- void Clear();
- bool Contains(TKey key);
- int Count { get; }
- IList
Get(TKey key); - bool RemoveAll(TKey key);
- bool Remove(TKey key, TValue value);
- bool TryGetValue(TKey key, out IList
list);
The default implementation is ListMap<TKey, TValue>.
An NUnit test suite is provided.
Contact Information
- Email:

