/// <summary>For internal debugging purposes only.</summary> public static void Main(string[] args) { string[] test = new string[] { "a", "b", "c" }; IList <string> l = Arrays.AsList(test); System.Console.Out.WriteLine(AsArrayList(l.GetEnumerator())); System.Console.Out.WriteLine(AsHashSet(l.GetEnumerator())); System.Console.Out.WriteLine(AsCollection(l.GetEnumerator(), CollectionFactory.HashSetFactory <string>())); List <string> al = new List <string>(); al.Add("d"); System.Console.Out.WriteLine(AddAll(l.GetEnumerator(), al)); }
/// <summary>Adds the value to the HashSet given by map.get(key), creating a new HashMap if needed.</summary> public static void PutIntoValueHashSet <K, V>(IDictionary <K, ICollection <V> > map, K key, V value) { CollectionFactory <V> factory = CollectionFactory.HashSetFactory(); PutIntoValueCollection(map, key, value, factory); }
/// <summary> /// Creates a new empty TwoDimensionalCollectionValuedMap which uses a HashMap as the /// underlying Map, and HashSets as the Collections in each mapping. /// </summary> /// <remarks> /// Creates a new empty TwoDimensionalCollectionValuedMap which uses a HashMap as the /// underlying Map, and HashSets as the Collections in each mapping. Does not /// treat Collections as immutable. /// </remarks> public TwoDimensionalCollectionValuedMap() : this(MapFactory.HashMapFactory <K2, ICollection <V> >(), CollectionFactory.HashSetFactory <V>(), false) { }
/// <summary> /// Creates a new empty CollectionValuedMap which uses a HashMap as the /// underlying Map, and HashSets as the Collections in each mapping. /// </summary> /// <remarks> /// Creates a new empty CollectionValuedMap which uses a HashMap as the /// underlying Map, and HashSets as the Collections in each mapping. Does not /// treat Collections as immutable. /// </remarks> public CollectionValuedMap() : this(MapFactory.HashMapFactory(), CollectionFactory.HashSetFactory(), false) { }