final class FilteredKeyListMultimap<K,V> extends FilteredKeyMultimap<K,V> implements ListMultimap<K,V>
Multimaps.filterKeys(ListMultimap, Predicate)
.FilteredKeyMultimap.AddRejectingList<K,V>, FilteredKeyMultimap.AddRejectingSet<K,V>, FilteredKeyMultimap.Entries
AbstractMultimap.EntrySet, AbstractMultimap.Values
keyPredicate, unfiltered
Constructor and Description |
---|
FilteredKeyListMultimap(ListMultimap<K,V> unfiltered,
Predicate<? super K> keyPredicate) |
Modifier and Type | Method and Description |
---|---|
java.util.List<V> |
get(K key)
Returns a view collection of the values associated with
key in this multimap, if any. |
java.util.List<V> |
removeAll(java.lang.Object key)
Removes all values associated with the key
key . |
java.util.List<V> |
replaceValues(K key,
java.lang.Iterable<? extends V> values)
Stores a collection of values with the same key, replacing any existing values for that key.
|
ListMultimap<K,V> |
unfiltered() |
clear, containsKey, createAsMap, createEntries, createKeys, createKeySet, createValues, entryIterator, entryPredicate, size, unmodifiableEmptyCollection
asMap, containsEntry, containsValue, entries, entrySpliterator, equals, hashCode, isEmpty, keys, keySet, put, putAll, putAll, remove, toString, valueIterator, values, valueSpliterator
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
asMap, equals
FilteredKeyListMultimap(ListMultimap<K,V> unfiltered, Predicate<? super K> keyPredicate)
public ListMultimap<K,V> unfiltered()
unfiltered
in interface FilteredMultimap<K,V>
unfiltered
in class FilteredKeyMultimap<K,V>
public java.util.List<V> 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<V> removeAll(@CheckForNull 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,V>
removeAll
in interface Multimap<K,V>
removeAll
in class FilteredKeyMultimap<K,V>
public java.util.List<V> replaceValues(K key, java.lang.Iterable<? extends V> values)
Multimap
If values
is empty, this is equivalent to removeAll(key)
.
replaceValues
in interface ListMultimap<K,V>
replaceValues
in interface Multimap<K,V>
replaceValues
in class AbstractMultimap<K,V>