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
class FilteredEntryMultimap<K,V> extends AbstractMultimap<K,V> implements FilteredMultimap<K,V>
Implementation ofMultimaps.filterEntries(Multimap, Predicate)
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
FilteredEntryMultimap.AsMap
(package private) class
FilteredEntryMultimap.Keys
(package private) class
FilteredEntryMultimap.ValuePredicate
-
Nested classes/interfaces inherited from class com.google.common.collect.AbstractMultimap
AbstractMultimap.Entries, AbstractMultimap.EntrySet, AbstractMultimap.Values
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Removes all key-value pairs from the multimap, leaving it empty.boolean
containsKey(java.lang.Object key)
Returnstrue
if this multimap contains at least one key-value pair with the keykey
.(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 withkey
in this multimap, if any.java.util.Collection<V>
removeAll(java.lang.Object key)
Removes all values associated with the keykey
.(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()
-
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
-
-
-
-
Method Detail
-
unfiltered
public Multimap<K,V> unfiltered()
- Specified by:
unfiltered
in interfaceFilteredMultimap<K,V>
-
entryPredicate
public Predicate<? super java.util.Map.Entry<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.
-
filterCollection
static <E> java.util.Collection<E> filterCollection(java.util.Collection<E> collection, Predicate<? super E> predicate)
-
containsKey
public boolean containsKey(@CheckForNull java.lang.Object key)
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
public java.util.Collection<V> removeAll(@CheckForNull java.lang.Object key)
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
java.util.Collection<V> unmodifiableEmptyCollection()
-
clear
public void clear()
Description copied from interface:Multimap
Removes all key-value pairs from the multimap, leaving it empty.
-
get
public java.util.Collection<V> get(K key)
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
java.util.Collection<java.util.Map.Entry<K,V>> createEntries()
- Specified by:
createEntries
in classAbstractMultimap<K,V>
-
createValues
java.util.Collection<V> createValues()
- Specified by:
createValues
in classAbstractMultimap<K,V>
-
entryIterator
java.util.Iterator<java.util.Map.Entry<K,V>> entryIterator()
- Specified by:
entryIterator
in classAbstractMultimap<K,V>
-
createAsMap
java.util.Map<K,java.util.Collection<V>> createAsMap()
- Specified by:
createAsMap
in classAbstractMultimap<K,V>
-
createKeySet
java.util.Set<K> createKeySet()
- Specified by:
createKeySet
in classAbstractMultimap<K,V>
-
removeEntriesIf
boolean removeEntriesIf(Predicate<? super java.util.Map.Entry<K,java.util.Collection<V>>> predicate)
-
createKeys
Multiset<K> createKeys()
- Specified by:
createKeys
in classAbstractMultimap<K,V>
-
-