Top Description Inners Fields Constructors Methods
com.google.common.collect

pack-priv Class FilteredKeyMultimap<K extends @Nullable Object, V extends @Nullable Object>

extends AbstractMultimap<K extends @Nullable Object, V extends @Nullable Object>
implements FilteredMultimap<K extends @Nullable Object, V extends @Nullable Object>
Class Inheritance
All Implemented Interfaces
com.google.common.collect.FilteredMultimap, com.google.common.collect.Multimap
Known Direct Subclasses
com.google.common.collect.FilteredKeySetMultimap, com.google.common.collect.FilteredKeyListMultimap
Annotations
@GwtCompatible
@ElementTypesAreNonnullByDefault
Static Imports
com.google.common.base.Preconditions.checkNotNull, .Preconditions.checkPositionIndex, java.util.Collections.emptyList, .Collections.emptySet

Implementation of Multimaps#filterKeys(Multimap, Predicate).
Author
Louis Wasserman

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class
pack-priv class

Field Summary

Modifier and TypeField and Description
pack-priv final Predicate<? super K>
pack-priv final Multimap<K, V>

Constructor Summary

AccessConstructor and Description
pack-priv
FilteredKeyMultimap(Multimap<K, V> unfiltered, Predicate<? super K> keyPredicate)

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Implements com.google.common.collect.Multimap.clear.

Removes all key-value pairs from the multimap, leaving it empty.
public boolean
containsKey(Object key)

Implements com.google.common.collect.Multimap.containsKey.

Returns true if this multimap contains at least one key-value pair with the key key.
pack-priv Map<K, Collection<V>>
pack-priv Collection<Map.Entry<K, V>>
pack-priv Multiset<K>
pack-priv Set<K>
pack-priv Collection<V>
pack-priv Iterator<Map.Entry<K, V>>
public Predicate<? super Map.Entry<K, V>>
public Collection<V>
get(K key)

Implements com.google.common.collect.Multimap.get.

Returns a view collection of the values associated with key in this multimap, if any.
public Collection<V>
removeAll(Object key)

Implements com.google.common.collect.Multimap.removeAll.

Removes all values associated with the key key.
public int
size()

Implements com.google.common.collect.Multimap.size.

Returns the number of key-value pairs in this multimap.
public Multimap<K, V>
pack-priv Collection<V>
Inherited from com.google.common.collect.AbstractMultimap:
asMapcontainsEntrycontainsValueentriesentrySpliteratorequalshashCodeisEmptykeyskeySetputputAllputAllremovereplaceValuestoStringvalueIteratorvaluesvalueSpliterator

Field Detail

keyPredicateback to summary
pack-priv final Predicate<? super K> keyPredicate
unfilteredback to summary
pack-priv final Multimap<K, V> unfiltered

Constructor Detail

FilteredKeyMultimapback to summary
pack-priv FilteredKeyMultimap(Multimap<K, V> unfiltered, Predicate<? super K> keyPredicate)

Method Detail

clearback to summary
public void clear()

Implements com.google.common.collect.Multimap.clear.

Doc from com.google.common.collect.Multimap.clear.

Removes all key-value pairs from the multimap, leaving it empty.

Annotations
@Override
containsKeyback to summary
public boolean containsKey(Object key)

Implements com.google.common.collect.Multimap.containsKey.

Doc from com.google.common.collect.Multimap.containsKey.

Returns true if this multimap contains at least one key-value pair with the key key.

Annotations
@Override
createAsMapback to summary
pack-priv Map<K, Collection<V>> createAsMap()

Implements abstract com.google.common.collect.AbstractMultimap.createAsMap.

Annotations
@Override
createEntriesback to summary
pack-priv Collection<Map.Entry<K, V>> createEntries()

Implements abstract com.google.common.collect.AbstractMultimap.createEntries.

Annotations
@Override
createKeysback to summary
pack-priv Multiset<K> createKeys()

Implements abstract com.google.common.collect.AbstractMultimap.createKeys.

Annotations
@Override
createKeySetback to summary
pack-priv Set<K> createKeySet()

Implements abstract com.google.common.collect.AbstractMultimap.createKeySet.

Annotations
@Override
createValuesback to summary
pack-priv Collection<V> createValues()

Implements abstract com.google.common.collect.AbstractMultimap.createValues.

Annotations
@Override
entryIteratorback to summary
pack-priv Iterator<Map.Entry<K, V>> entryIterator()

Implements abstract com.google.common.collect.AbstractMultimap.entryIterator.

Annotations
@Override
entryPredicateback to summary
public Predicate<? super Map.Entry<K, V>> entryPredicate()

Implements com.google.common.collect.FilteredMultimap.entryPredicate.

Annotations
@Override
getback to summary
public Collection<V> get(K key)

Implements com.google.common.collect.Multimap.get.

Doc from com.google.common.collect.Multimap.get.

Returns a view collection of the values associated with 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.

Annotations
@Override
removeAllback to summary
public Collection<V> removeAll(Object key)

Implements com.google.common.collect.Multimap.removeAll.

Doc from com.google.common.collect.Multimap.removeAll.

Removes all values associated with the key key.

Once this method returns, key will not be mapped to any values, so it will not appear in keySet(), asMap(), or any other views.

Returns:Collection<V>

the values that were removed (possibly empty). The returned collection may be modifiable, but updating it will have no effect on the multimap.

Annotations
@Override
sizeback to summary
public int size()

Implements com.google.common.collect.Multimap.size.

Doc from com.google.common.collect.Multimap.size.

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() or asMap().size(). See the opening section of the Multimap class documentation for clarification.

Annotations
@Override
unfilteredback to summary
public Multimap<K, V> unfiltered()

Implements com.google.common.collect.FilteredMultimap.unfiltered.

Annotations
@Override
unmodifiableEmptyCollectionback to summary
pack-priv Collection<V> unmodifiableEmptyCollection()
com.google.common.collect back to summary

pack-priv Class FilteredKeyMultimap.AddRejectingList<K extends @Nullable Object, V extends @Nullable Object>

extends ForwardingList<V extends @Nullable Object>
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final K

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
add(V
element to be appended to this list
v
)

Overrides com.google.common.collect.ForwardingCollection.add.

Implements java.util.List.add, java.util.Collection.add.

Appends the specified element to the end of this list (optional operation).
public void
add(int
index at which the specified element is to be inserted
index
,
V
element to be inserted
element
)

Overrides com.google.common.collect.ForwardingList.add.

Implements java.util.List.add.

Inserts the specified element at the specified position in this list (optional operation).
public boolean
addAll(Collection<? extends V>
collection containing elements to be added to this list
collection
)

Overrides com.google.common.collect.ForwardingCollection.addAll.

Implements java.util.List.addAll, java.util.Collection.addAll.

Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation).
public boolean
addAll(int
index at which to insert the first element from the specified collection
index
,
Collection<? extends V>
collection containing elements to be added to this list
elements
)

Overrides com.google.common.collect.ForwardingList.addAll.

Implements java.util.List.addAll.

Inserts all of the elements in the specified collection into this list at the specified position (optional operation).
protected List<V>
delegate()

Implements abstract com.google.common.collect.ForwardingList.delegate.

Returns the backing delegate instance that methods are forwarded to.
Inherited from com.google.common.collect.ForwardingList:
equalsgethashCodeindexOflastIndexOflistIteratorlistIteratorremovesetstandardAddstandardAddAllstandardEqualsstandardHashCodestandardIndexOfstandardIteratorstandardLastIndexOfstandardListIteratorstandardListIteratorstandardSubListsubList

Field Detail

keyback to summary
pack-priv final K key
Annotations
@ParametricNullness

Constructor Detail

AddRejectingListback to summary
pack-priv AddRejectingList(K key)

Method Detail

addback to summary
public boolean add(V v)

Overrides com.google.common.collect.ForwardingCollection.add.

Implements java.util.List.add, java.util.Collection.add.

Doc from java.util.List.add.

Appends the specified element to the end of this list (optional operation).

Lists that support this operation may place limitations on what elements may be added to this list. In particular, some lists will refuse to add null elements, and others will impose restrictions on the type of elements that may be added. List classes should clearly specify in their documentation any restrictions on what elements may be added.

Parameters
v:V

element to be appended to this list

Returns:boolean

true (as specified by Collection#add)

Annotations
@Override
addback to summary
public void add(int index, V element)

Overrides com.google.common.collect.ForwardingList.add.

Implements java.util.List.add.

Doc from java.util.List.add.

Inserts the specified element at the specified position in this list (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

Parameters
index:int

index at which the specified element is to be inserted

element:V

element to be inserted

Annotations
@Override
addAllback to summary
public boolean addAll(Collection<? extends V> collection)

Overrides com.google.common.collect.ForwardingCollection.addAll.

Implements java.util.List.addAll, java.util.Collection.addAll.

Doc from java.util.List.addAll.

Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation). The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)

Parameters
collection:Collection<? extends V>

collection containing elements to be added to this list

Returns:boolean

true if this list changed as a result of the call

Annotations
@Override
addAllback to summary
public boolean addAll(int index, Collection<? extends V> elements)

Overrides com.google.common.collect.ForwardingList.addAll.

Implements java.util.List.addAll.

Doc from java.util.List.addAll.

Inserts all of the elements in the specified collection into this list at the specified position (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in this list in the order that they are returned by the specified collection's iterator. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)

Parameters
index:int

index at which to insert the first element from the specified collection

elements:Collection<? extends V>

collection containing elements to be added to this list

Returns:boolean

true if this list changed as a result of the call

Annotations
@CanIgnoreReturnValue
@Override
delegateback to summary
protected List<V> delegate()

Implements abstract com.google.common.collect.ForwardingList.delegate.

Doc from com.google.common.collect.ForwardingObject.delegate.

Returns the backing delegate instance that methods are forwarded to. Abstract subclasses generally override this method with an abstract method that has a more specific return type, such as ForwardingSet#delegate. Concrete subclasses override this method to supply the instance being decorated.

Annotations
@Override
com.google.common.collect back to summary

pack-priv Class FilteredKeyMultimap.AddRejectingSet<K extends @Nullable Object, V extends @Nullable Object>

extends ForwardingSet<V extends @Nullable Object>
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final K

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
add(V
element to be added to this set
element
)

Overrides com.google.common.collect.ForwardingCollection.add.

Implements java.util.Set.add, java.util.Collection.add.

Adds the specified element to this set if it is not already present (optional operation).
public boolean
addAll(Collection<? extends V>
collection containing elements to be added to this set
collection
)

Overrides com.google.common.collect.ForwardingCollection.addAll.

Implements java.util.Set.addAll, java.util.Collection.addAll.

Adds all of the elements in the specified collection to this set if they're not already present (optional operation).
protected Set<V>
delegate()

Implements abstract com.google.common.collect.ForwardingSet.delegate.

Returns the backing delegate instance that methods are forwarded to.
Inherited from com.google.common.collect.ForwardingSet:
equalshashCodestandardEqualsstandardHashCodestandardRemoveAll

Field Detail

keyback to summary
pack-priv final K key
Annotations
@ParametricNullness

Constructor Detail

AddRejectingSetback to summary
pack-priv AddRejectingSet(K key)

Method Detail

addback to summary
public boolean add(V element)

Overrides com.google.common.collect.ForwardingCollection.add.

Implements java.util.Set.add, java.util.Collection.add.

Doc from java.util.Set.add.

Adds the specified element to this set if it is not already present (optional operation). More formally, adds the specified element e to this set if the set contains no element e2 such that Objects.equals(e, e2). If this set already contains the element, the call leaves the set unchanged and returns false. In combination with the restriction on constructors, this ensures that sets never contain duplicate elements.

The stipulation above does not imply that sets must accept all elements; sets may refuse to add any particular element, including null, and throw an exception, as described in the specification for Collection.add. Individual set implementations should clearly document any restrictions on the elements that they may contain.

Parameters
element:V

element to be added to this set

Returns:boolean

true if this set did not already contain the specified element

Annotations
@Override
addAllback to summary
public boolean addAll(Collection<? extends V> collection)

Overrides com.google.common.collect.ForwardingCollection.addAll.

Implements java.util.Set.addAll, java.util.Collection.addAll.

Doc from java.util.Set.addAll.

Adds all of the elements in the specified collection to this set if they're not already present (optional operation). If the specified collection is also a set, the addAll operation effectively modifies this set so that its value is the union of the two sets. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress.

Parameters
collection:Collection<? extends V>

collection containing elements to be added to this set

Returns:boolean

true if this set changed as a result of the call

Annotations
@Override
delegateback to summary
protected Set<V> delegate()

Implements abstract com.google.common.collect.ForwardingSet.delegate.

Doc from com.google.common.collect.ForwardingObject.delegate.

Returns the backing delegate instance that methods are forwarded to. Abstract subclasses generally override this method with an abstract method that has a more specific return type, such as ForwardingSet#delegate. Concrete subclasses override this method to supply the instance being decorated.

Annotations
@Override
com.google.common.collect back to summary

pack-priv Class FilteredKeyMultimap.Entries

extends ForwardingCollection<Map.Entry<K extends @Nullable Object, V extends @Nullable Object>>
Class Inheritance
Known Direct Subclasses
com.google.common.collect.FilteredKeySetMultimap.EntrySet
Annotations
@WeakOuter

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected Collection<Map.Entry<K, V>>
delegate()

Implements abstract com.google.common.collect.ForwardingCollection.delegate.

Returns the backing delegate instance that methods are forwarded to.
public boolean
remove(Object
element to be removed from this collection, if present
o
)

Overrides com.google.common.collect.ForwardingCollection.remove.

Implements java.util.Collection.remove.

Removes a single instance of the specified element from this collection, if it is present (optional operation).
Inherited from com.google.common.collect.ForwardingCollection:
addaddAllclearcontainscontainsAllisEmptyiteratorremoveAllretainAllsizestandardAddAllstandardClearstandardContainsstandardContainsAllstandardIsEmptystandardRemovestandardRemoveAllstandardRetainAllstandardToArraystandardToArraystandardToStringtoArraytoArray

Constructor Detail

Entriesback to summary
pack-priv Entries()

Method Detail

delegateback to summary
protected Collection<Map.Entry<K, V>> delegate()

Implements abstract com.google.common.collect.ForwardingCollection.delegate.

Doc from com.google.common.collect.ForwardingObject.delegate.

Returns the backing delegate instance that methods are forwarded to. Abstract subclasses generally override this method with an abstract method that has a more specific return type, such as ForwardingSet#delegate. Concrete subclasses override this method to supply the instance being decorated.

Annotations
@Override
removeback to summary
public boolean remove(Object o)

Overrides com.google.common.collect.ForwardingCollection.remove.

Implements java.util.Collection.remove.

Doc from java.util.Collection.remove.

Removes a single instance of the specified element from this collection, if it is present (optional operation). More formally, removes an element e such that Objects.equals(o, e), if this collection contains one or more such elements. Returns true if this collection contained the specified element (or equivalently, if this collection changed as a result of the call).

Parameters
o:Object

element to be removed from this collection, if present

Returns:boolean

true if an element was removed as a result of this call

Annotations
@Override
@SuppressWarnings:unchecked