K - The key typeV - The value typepublic class SetMultimap<K,V> extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all of the mappings.
|
boolean |
containsKey(Object key) |
Set<Map.Entry<K,Collection<V>>> |
entrySet()
Map.Entry.getValue() always returns an unmodifiable collection. |
C |
get(K key)
This method never returns null.
|
boolean |
isEmpty() |
Set<K> |
keySet() |
static <K,V> SetMultimap<K,V> |
newConcurrentSetMultimap()
Creates a new instance backed by a
ConcurrentHashMap and synchronized HashSet. |
static <K,V> SetMultimap<K,V> |
newConcurrentSetMultimap(Supplier<Set<V>> valueSupplier)
Creates a new instance backed by a
ConcurrentHashMap and synchronized HashSet. |
static <K,V> SetMultimap<K,V> |
newSetMultimap()
|
static <K,V> SetMultimap<K,V> |
newSetMultimap(Multimap<K,V> multimap)
|
boolean |
put(K key,
V value) |
boolean |
putAll(K key,
Collection<? extends V> values) |
C |
replaceValues(K key,
Iterable<? extends V> values)
Note that the original collection of values is completely replaced by a new collection which contains all elements from the given iterable.
|
int |
size()
Unlike
com.google.common.collect.Multimap#size() this method returns the number of key-value mappings. |
String |
toString() |
Set<V> |
uniqueValues() |
List<V> |
values()
The list may include the same value multiple times if it occurs in multiple mappings or if the collection of values for the mapping allows duplicate
elements.
|
protected final Supplier<C extends Collection<V>> supplier
public static <K,V> SetMultimap<K,V> newSetMultimap()
public static <K,V> SetMultimap<K,V> newSetMultimap(Multimap<K,V> multimap)
HashMap and HashSet. All key-value mappings are copied from the input multimap. If any
collection of values in the input multimap contains duplicate elements, these are removed in the constructed multimap.multimap - public static <K,V> SetMultimap<K,V> newConcurrentSetMultimap()
ConcurrentHashMap and synchronized HashSet.public static <K,V> SetMultimap<K,V> newConcurrentSetMultimap(Supplier<Set<V>> valueSupplier)
ConcurrentHashMap and synchronized HashSet.public int size()
Multimapcom.google.common.collect.Multimap#size() this method returns the number of key-value mappings.public boolean isEmpty()
public C get(K key)
Multimappublic boolean putAll(K key, Collection<? extends V> values)
public C replaceValues(K key, Iterable<? extends V> values)
MultimapreplaceValues in interface Multimap<K,V>public boolean containsKey(Object key)
containsKey in interface Multimap<K,V>true if the multimap contains a mapping for the given keypublic List<V> values()
Multimappublic Set<V> uniqueValues()
uniqueValues in interface Multimap<K,V>public Set<Map.Entry<K,Collection<V>>> entrySet()
MultimapMap.Entry.getValue() always returns an unmodifiable collection. Map.Entry.setValue(Object) operation is not supported.public void clear()
MultimapCopyright © 2017. All rights reserved.