class FilteredEntryMultimap<K,V> extends AbstractMultimap<K,V> implements FilteredMultimap<K,V>
Multimaps.filterEntries(Multimap, Predicate).| Modifier and Type | Class and Description |
|---|---|
(package private) class |
FilteredEntryMultimap.AsMap |
(package private) class |
FilteredEntryMultimap.Keys |
(package private) class |
FilteredEntryMultimap.ValuePredicate |
AbstractMultimap.Entries, AbstractMultimap.EntrySet, AbstractMultimap.Values| Modifier and Type | Field and Description |
|---|---|
(package private) Predicate<? super java.util.Map.Entry<K,V>> |
predicate |
(package private) Multimap<K,V> |
unfiltered |
| Constructor and Description |
|---|
FilteredEntryMultimap(Multimap<K,V> unfiltered,
Predicate<? super java.util.Map.Entry<K,V>> predicate) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all key-value pairs from the multimap, leaving it empty.
|
boolean |
containsKey(java.lang.Object key)
Returns
true if this multimap contains at least one key-value pair with the key key. |
(package private) java.util.Map<K,java.util.Collection<V>> |
createAsMap() |
(package private) java.util.Collection<java.util.Map.Entry<K,V>> |
createEntries() |
(package private) Multiset<K> |
createKeys() |
(package private) java.util.Set<K> |
createKeySet() |
(package private) java.util.Collection<V> |
createValues() |
(package private) java.util.Iterator<java.util.Map.Entry<K,V>> |
entryIterator() |
Predicate<? super java.util.Map.Entry<K,V>> |
entryPredicate() |
(package private) static <E> java.util.Collection<E> |
filterCollection(java.util.Collection<E> collection,
Predicate<? super E> predicate) |
java.util.Collection<V> |
get(K key)
Returns a view collection of the values associated with
key in this multimap, if any. |
java.util.Collection<V> |
removeAll(java.lang.Object key)
Removes all values associated with the key
key. |
(package private) boolean |
removeEntriesIf(Predicate<? super java.util.Map.Entry<K,java.util.Collection<V>>> predicate) |
private boolean |
satisfies(K key,
V value) |
int |
size()
Returns the number of key-value pairs in this multimap.
|
Multimap<K,V> |
unfiltered() |
(package private) java.util.Collection<V> |
unmodifiableEmptyCollection() |
asMap, containsEntry, containsValue, entries, entrySpliterator, equals, hashCode, isEmpty, keys, keySet, put, putAll, putAll, remove, replaceValues, toString, valueIterator, values, valueSpliteratorpublic Multimap<K,V> unfiltered()
unfiltered in interface FilteredMultimap<K,V>public Predicate<? super java.util.Map.Entry<K,V>> entryPredicate()
entryPredicate in interface FilteredMultimap<K,V>public int size()
MultimapNote: this method does not return the number of distinct keys in the multimap,
which is given by keySet().size() or asMap().size(). See the opening section of
the Multimap class documentation for clarification.
static <E> java.util.Collection<E> filterCollection(java.util.Collection<E> collection,
Predicate<? super E> predicate)
public boolean containsKey(@CheckForNull
java.lang.Object key)
Multimaptrue if this multimap contains at least one key-value pair with the key key.containsKey in interface Multimap<K,V>public java.util.Collection<V> removeAll(@CheckForNull java.lang.Object key)
Multimapkey.
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.
java.util.Collection<V> unmodifiableEmptyCollection()
public void clear()
Multimappublic java.util.Collection<V> get(K key)
Multimapkey 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.
java.util.Collection<java.util.Map.Entry<K,V>> createEntries()
createEntries in class AbstractMultimap<K,V>java.util.Collection<V> createValues()
createValues in class AbstractMultimap<K,V>java.util.Iterator<java.util.Map.Entry<K,V>> entryIterator()
entryIterator in class AbstractMultimap<K,V>java.util.Map<K,java.util.Collection<V>> createAsMap()
createAsMap in class AbstractMultimap<K,V>java.util.Set<K> createKeySet()
createKeySet in class AbstractMultimap<K,V>boolean removeEntriesIf(Predicate<? super java.util.Map.Entry<K,java.util.Collection<V>>> predicate)
Multiset<K> createKeys()
createKeys in class AbstractMultimap<K,V>