Package com.google.common.collect
Class FilteredKeyMultimap<K,V>
- java.lang.Object
-
- com.google.common.collect.AbstractMultimap<K,V>
-
- com.google.common.collect.FilteredKeyMultimap<K,V>
-
- All Implemented Interfaces:
FilteredMultimap<K,V>,Multimap<K,V>
- Direct Known Subclasses:
FilteredKeyListMultimap,FilteredKeySetMultimap
@GwtCompatible class FilteredKeyMultimap<K,V> extends AbstractMultimap<K,V> implements FilteredMultimap<K,V>
Implementation ofMultimaps.filterKeys(Multimap, Predicate).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classFilteredKeyMultimap.AddRejectingList<K,V>(package private) static classFilteredKeyMultimap.AddRejectingSet<K,V>(package private) classFilteredKeyMultimap.Entries-
Nested classes/interfaces inherited from class com.google.common.collect.AbstractMultimap
AbstractMultimap.EntrySet, AbstractMultimap.Values
-
-
Field Summary
Fields Modifier and Type Field Description (package private) Predicate<? super K>keyPredicate(package private) Multimap<K,V>unfiltered
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Removes all key-value pairs from the multimap, leaving it empty.booleancontainsKey(java.lang.Object key)Returnstrueif 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()java.util.Collection<V>get(K key)Returns a view collection of the values associated withkeyin this multimap, if any.java.util.Collection<V>removeAll(java.lang.Object key)Removes all values associated with the keykey.intsize()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:
unfilteredin interfaceFilteredMultimap<K,V>
-
entryPredicate
public Predicate<? super java.util.Map.Entry<K,V>> entryPredicate()
- Specified by:
entryPredicatein interfaceFilteredMultimap<K,V>
-
size
public int size()
Description copied from interface:MultimapReturns 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 theMultimapclass documentation for clarification.
-
containsKey
public boolean containsKey(java.lang.Object key)
Description copied from interface:MultimapReturnstrueif this multimap contains at least one key-value pair with the keykey.- Specified by:
containsKeyin interfaceMultimap<K,V>
-
removeAll
public java.util.Collection<V> removeAll(java.lang.Object key)
Description copied from interface:MultimapRemoves all values associated with the keykey.Once this method returns,
keywill 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:MultimapRemoves all key-value pairs from the multimap, leaving it empty.
-
createKeySet
java.util.Set<K> createKeySet()
- Specified by:
createKeySetin classAbstractMultimap<K,V>
-
get
public java.util.Collection<V> get(K key)
Description copied from interface:MultimapReturns a view collection of the values associated withkeyin 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.
-
entryIterator
java.util.Iterator<java.util.Map.Entry<K,V>> entryIterator()
- Specified by:
entryIteratorin classAbstractMultimap<K,V>
-
createEntries
java.util.Collection<java.util.Map.Entry<K,V>> createEntries()
- Specified by:
createEntriesin classAbstractMultimap<K,V>
-
createValues
java.util.Collection<V> createValues()
- Specified by:
createValuesin classAbstractMultimap<K,V>
-
createAsMap
java.util.Map<K,java.util.Collection<V>> createAsMap()
- Specified by:
createAsMapin classAbstractMultimap<K,V>
-
createKeys
Multiset<K> createKeys()
- Specified by:
createKeysin classAbstractMultimap<K,V>
-
-