public class Collections extends Object
| Modifier and Type | Method and Description |
|---|---|
static <K> boolean |
containsAny(Set<K> aSet,
K[] arr)
Checks whether any of an array's elements are also in the provided set.
|
static <K> Set<K> |
intersection(Collection<Set<K>> sets) |
static <K> Set<K> |
intersection(Set<K>... sets) |
static <K,V> HashMap<K,V> |
newHashMap(int expectedCapacity) |
static <K,V> void |
putList(Map<K,List<V>> map,
K key,
V valueElt)
Puts a value into a map of key -> list of values.
|
static <K,V> void |
putListMult(Map<K,List<V>> map,
K key,
Collection<? extends V> values)
Puts a collection of values into a map of key -> list of values.
|
static <K,V> void |
putSet(Map<K,Set<V>> map,
K key,
V valueElt)
Puts a value into a map of key -> set of values.
|
static <K,V> void |
putSetAll(Map<K,Set<V>> map,
Map<K,Set<V>> other)
Copies all of the mappings from the second map to the first.
|
static <K,V> void |
putSetMult(Map<K,Set<V>> map,
K key,
Collection<? extends V> values)
Puts a collection of values into a map of key -> set of values.
|
public static <K,V> void putList(Map<K,List<V>> map, K key, V valueElt)
ArrayList as its value.map - a Map.key - a key.valueElt - a value.public static <K,V> void putListMult(Map<K,List<V>> map, K key, Collection<? extends V> values)
ArrayList as its
value.map - a Map.key - a key.values - a Collection of values.public static <K,V> void putSet(Map<K,Set<V>> map, K key, V valueElt)
HashSet as its value.map - a Map.key - a key.valueElt - a value.public static <K,V> void putSetMult(Map<K,Set<V>> map, K key, Collection<? extends V> values)
ArrayList as its
value.map - a Map.key - a key.values - a Collection of values.public static <K,V> void putSetAll(Map<K,Set<V>> map, Map<K,Set<V>> other)
public static <K> boolean containsAny(Set<K> aSet, K[] arr)
aSet - a Set.arr - an array.true or false.public static <K> Set<K> intersection(Collection<Set<K>> sets)
@SafeVarargs public static <K> Set<K> intersection(Set<K>... sets)
public static <K,V> HashMap<K,V> newHashMap(int expectedCapacity)
Copyright © 2012–2018 Emory University. All rights reserved.