Package com.google.common.collect
Class FilteredEntryMultimap<K,V>
java.lang.Object
com.google.common.collect.AbstractMultimap<K,V>
com.google.common.collect.FilteredEntryMultimap<K,V>
- All Implemented Interfaces:
FilteredMultimap<K,
,V> Multimap<K,
V>
- Direct Known Subclasses:
FilteredEntrySetMultimap
Implementation of
Multimaps.filterEntries(Multimap, Predicate)
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
(package private) class
(package private) final class
Nested classes/interfaces inherited from class com.google.common.collect.AbstractMultimap
AbstractMultimap.Entries, AbstractMultimap.EntrySet, AbstractMultimap.Values
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Removes all key-value pairs from the multimap, leaving it empty.boolean
containsKey
(Object key) Returnstrue
if this multimap contains at least one key-value pair with the keykey
.(package private) Map
<K, Collection<V>> (package private) Collection
<Map.Entry<K, V>> (package private) Collection
<V> (package private) static <E> Collection
<E> filterCollection
(Collection<E> collection, Predicate<? super E> predicate) Returns a view collection of the values associated withkey
in this multimap, if any.Removes all values associated with the keykey
.(package private) boolean
removeEntriesIf
(Predicate<? super Map.Entry<K, Collection<V>>> predicate) private boolean
int
size()
Returns the number of key-value pairs in this multimap.(package private) Collection
<V> Methods inherited from class com.google.common.collect.AbstractMultimap
asMap, containsEntry, containsValue, entries, entrySpliterator, equals, hashCode, isEmpty, keys, keySet, put, putAll, putAll, remove, replaceValues, toString, valueIterator, values, valueSpliterator
-
Field Details
-
unfiltered
-
predicate
-
-
Constructor Details
-
FilteredEntryMultimap
-
-
Method Details
-
unfiltered
- Specified by:
unfiltered
in interfaceFilteredMultimap<K,
V>
-
entryPredicate
- Specified by:
entryPredicate
in interfaceFilteredMultimap<K,
V>
-
size
public int size()Description copied from interface:Multimap
Returns the number of key-value pairs in this multimap.Note: this method does not return the number of distinct keys in the multimap, which is given by
keySet().size()
orasMap().size()
. See the opening section of theMultimap
class documentation for clarification. -
satisfies
-
filterCollection
-
containsKey
Description copied from interface:Multimap
Returnstrue
if this multimap contains at least one key-value pair with the keykey
.- Specified by:
containsKey
in interfaceMultimap<K,
V>
-
removeAll
Description copied from interface:Multimap
Removes all values associated with the keykey
.Once this method returns,
key
will not be mapped to any values, so it will not appear inMultimap.keySet()
,Multimap.asMap()
, or any other views. -
unmodifiableEmptyCollection
Collection<V> unmodifiableEmptyCollection() -
clear
public void clear()Description copied from interface:Multimap
Removes all key-value pairs from the multimap, leaving it empty. -
get
Description copied from interface:Multimap
Returns a view collection of the values associated withkey
in this multimap, if any. Note that whencontainsKey(key)
is false, this returns an empty collection, notnull
.Changes to the returned collection will update the underlying multimap, and vice versa.
-
createEntries
Collection<Map.Entry<K,V>> createEntries()- Specified by:
createEntries
in classAbstractMultimap<K,
V>
-
createValues
Collection<V> createValues()- Specified by:
createValues
in classAbstractMultimap<K,
V>
-
entryIterator
- Specified by:
entryIterator
in classAbstractMultimap<K,
V>
-
createAsMap
Map<K,Collection<V>> createAsMap()- Specified by:
createAsMap
in classAbstractMultimap<K,
V>
-
createKeySet
- Specified by:
createKeySet
in classAbstractMultimap<K,
V>
-
removeEntriesIf
-
createKeys
- Specified by:
createKeys
in classAbstractMultimap<K,
V>
-