19 using System.Collections.Generic;
21 namespace Lucene.Net.Util
25 public class MapOfSets<TKey, TValue>
27 private IDictionary<TKey, HashSet<TValue>> theMap;
31 public MapOfSets(IDictionary<TKey, HashSet<TValue>> m)
37 public virtual IDictionary<TKey, HashSet<TValue>> Map
39 get {
return theMap; }
47 public virtual int Put(TKey key, TValue val)
49 HashSet<TValue> theSet;
50 if (!theMap.TryGetValue(key, out theSet))
52 theSet =
new HashSet<TValue>();
64 public virtual int PutAll(TKey key, IEnumerable<TValue> vals)
66 HashSet<TValue> theSet;
67 if (!theMap.TryGetValue(key, out theSet))
69 theSet =
new HashSet<TValue>();
72 theSet.UnionWith(vals);