K - V - public class ListMultimap<K,V> extends Object
| Constructor and Description |
|---|
ListMultimap()
|
ListMultimap(Multimap<K,V> multimap)
|
ListMultimap(Supplier<Map<K,List<V>>> mapSupplier,
Supplier<ConcurrentMap<K,List<V>>> concurrentMapSupplier,
Supplier<List<V>> collectionSupplier,
Multimap<K,V> multimap) |
| 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() |
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 ListMultimap()
public ListMultimap(Multimap<K,V> multimap)
HashMap and ArrayList. All key-value mappings are copied from the input multimap.multimap - 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.