/** * 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. */ public TwoDimensionalCollectionValuedMap() { this(MapFactory.<K2,Collection<V>>hashMapFactory(), CollectionFactory.<V>hashSetFactory(), false); }
/** * 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. */ public CollectionValuedMap() { this(MapFactory.hashMapFactory(), CollectionFactory.hashSetFactory(), false); }
/** * Adds the value to the HashSet given by map.get(key), creating a new HashMap if needed. * */ public static <K, V> void putIntoValueHashSet(Map<K, Set<V>> map, K key, V value) { CollectionFactory<V> factory = CollectionFactory.hashSetFactory(); putIntoValueCollection(map, key, value, factory); }
/** * For internal debugging purposes only. */ public static void main(String[] args) { String[] test = {"a", "b", "c"}; List<String> l = Arrays.asList(test); System.out.println(asArrayList(l.iterator())); System.out.println(asHashSet(l.iterator())); System.out.println(asCollection(l.iterator(), CollectionFactory.<String>hashSetFactory())); ArrayList<String> al = new ArrayList<>(); al.add("d"); System.out.println(addAll(l.iterator(), al)); }
public static <K,V> CollectionValuedMap<Iterable<K>, V> collectionValuedTrieMap() { return new CollectionValuedMap<>( TrieMapUtils.<K, Collection<V>>trieMapFactory(), CollectionFactory.<V>hashSetFactory(), false); }
/** * 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. */ public CollectionValuedMap() { this(MapFactory.hashMapFactory(), CollectionFactory.hashSetFactory(), false); }
/** * 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. */ public TwoDimensionalCollectionValuedMap() { this(MapFactory.<K2,Collection<V>>hashMapFactory(), CollectionFactory.<V>hashSetFactory(), false); }
/** * 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. */ public TwoDimensionalCollectionValuedMap() { this(MapFactory.<K2,Collection<V>>hashMapFactory(), CollectionFactory.<V>hashSetFactory(), false); }
/** * Adds the value to the HashSet given by map.get(key), creating a new HashMap if needed. * */ public static <K, V> void putIntoValueHashSet(Map<K, Set<V>> map, K key, V value) { CollectionFactory<V> factory = CollectionFactory.hashSetFactory(); putIntoValueCollection(map, key, value, factory); }
/** * 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. */ public CollectionValuedMap() { this(MapFactory.<K, Collection<V>> hashMapFactory(), CollectionFactory.<V> hashSetFactory(), false); }
/** * Adds the value to the HashSet given by map.get(key), creating a new HashMap if needed. * */ public static <K, V> void putIntoValueHashSet(Map<K, Set<V>> map, K key, V value) { CollectionFactory<V> factory = CollectionFactory.hashSetFactory(); putIntoValueCollection(map, key, value, factory); }
/** * 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. */ public CollectionValuedMap() { this(MapFactory.hashMapFactory(), CollectionFactory.hashSetFactory(), false); }
/** * 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. */ public TwoDimensionalCollectionValuedMap() { this(MapFactory.<K2,Collection<V>>hashMapFactory(), CollectionFactory.<V>hashSetFactory(), false); }
/** * Adds the value to the HashSet given by map.get(key), creating a new HashMap if needed. * */ public static <K, V> void putIntoValueHashSet(Map<K, Set<V>> map, K key, V value) { CollectionFactory<V> factory = CollectionFactory.hashSetFactory(); putIntoValueCollection(map, key, value, factory); }
/** * Adds the value to the HashSet given by map.get(key), creating a new HashMap if needed. * */ public static <K, V> void putIntoValueHashSet(Map<K, Set<V>> map, K key, V value) { CollectionFactory<V> factory = CollectionFactory.hashSetFactory(); putIntoValueCollection(map, key, value, factory); }
/** * 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. */ public CollectionValuedMap() { this(MapFactory.<K,Collection<V>>hashMapFactory(), CollectionFactory.<V>hashSetFactory(), false); }
/** * For internal debugging purposes only. */ public static void main(String[] args) { String[] test = {"a", "b", "c"}; List<String> l = Arrays.asList(test); System.out.println(asArrayList(l.iterator())); System.out.println(asHashSet(l.iterator())); System.out.println(asCollection(l.iterator(), CollectionFactory.<String>hashSetFactory())); ArrayList<String> al = new ArrayList<>(); al.add("d"); System.out.println(addAll(l.iterator(), al)); }
/** * For internal debugging purposes only. */ public static void main(String[] args) { String[] test = {"a", "b", "c"}; List<String> l = Arrays.asList(test); System.out.println(asArrayList(l.iterator())); System.out.println(asHashSet(l.iterator())); System.out.println(asCollection(l.iterator(), CollectionFactory.<String>hashSetFactory())); ArrayList<String> al = new ArrayList<String>(); al.add("d"); System.out.println(addAll(l.iterator(), al)); }
/** * For internal debugging purposes only. */ public static void main(String[] args) { String[] test = {"a", "b", "c"}; List<String> l = Arrays.asList(test); System.out.println(asArrayList(l.iterator())); System.out.println(asHashSet(l.iterator())); System.out.println(asCollection(l.iterator(), CollectionFactory.<String>hashSetFactory())); ArrayList<String> al = new ArrayList<>(); al.add("d"); System.out.println(addAll(l.iterator(), al)); }