private static final class Multimaps.TransformedEntriesListMultimap<K,V1,V2> extends Multimaps.TransformedEntriesMultimap<K,V1,V2> implements ListMultimap<K,V2>
AbstractMultimap.Entries, AbstractMultimap.EntrySet, AbstractMultimap.Values
fromMultimap, transformer
Constructor and Description |
---|
TransformedEntriesListMultimap(ListMultimap<K,V1> fromMultimap,
Maps.EntryTransformer<? super K,? super V1,V2> transformer) |
Modifier and Type | Method and Description |
---|---|
java.util.List<V2> |
get(K key)
Returns a view collection of the values associated with
key in this multimap, if any. |
java.util.List<V2> |
removeAll(java.lang.Object key)
Removes all values associated with the key
key . |
java.util.List<V2> |
replaceValues(K key,
java.lang.Iterable<? extends V2> values)
Stores a collection of values with the same key, replacing any existing values for that key.
|
(package private) java.util.List<V2> |
transform(K key,
java.util.Collection<V1> values) |
clear, containsKey, createAsMap, createEntries, createKeys, createKeySet, createValues, entryIterator, isEmpty, put, putAll, putAll, remove, size
asMap, containsEntry, containsValue, entries, entrySpliterator, equals, hashCode, keys, keySet, toString, valueIterator, values, valueSpliterator
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
asMap, equals
TransformedEntriesListMultimap(ListMultimap<K,V1> fromMultimap, Maps.EntryTransformer<? super K,? super V1,V2> transformer)
java.util.List<V2> transform(K key, java.util.Collection<V1> values)
transform
in class Multimaps.TransformedEntriesMultimap<K,V1,V2>
public java.util.List<V2> get(K key)
Multimap
key
in this multimap, if any.
Note that when containsKey(key)
is false, this returns an empty collection, not null
.
Changes to the returned collection will update the underlying multimap, and vice versa.
public java.util.List<V2> removeAll(java.lang.Object key)
Multimap
key
.
Once this method returns, key
will not be mapped to any values, so it will not
appear in Multimap.keySet()
, Multimap.asMap()
, or any other views.
removeAll
in interface ListMultimap<K,V2>
removeAll
in interface Multimap<K,V2>
removeAll
in class Multimaps.TransformedEntriesMultimap<K,V1,V2>
public java.util.List<V2> replaceValues(K key, java.lang.Iterable<? extends V2> values)
Multimap
If values
is empty, this is equivalent to removeAll(key)
.
replaceValues
in interface ListMultimap<K,V2>
replaceValues
in interface Multimap<K,V2>
replaceValues
in class Multimaps.TransformedEntriesMultimap<K,V1,V2>