Package com.google.common.collect
Class FilteredEntryMultimap.Keys
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- com.google.common.collect.AbstractMultiset<K>
-
- com.google.common.collect.Multimaps.Keys<K,V>
-
- com.google.common.collect.FilteredEntryMultimap.Keys
-
- All Implemented Interfaces:
Multiset<K>
,java.lang.Iterable<K>
,java.util.Collection<K>
- Enclosing class:
- FilteredEntryMultimap<K,V>
class FilteredEntryMultimap.Keys extends Multimaps.Keys<K,V>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.collect.Multimaps.Keys
Multimaps.Keys.KeysEntrySet
-
Nested classes/interfaces inherited from class com.google.common.collect.AbstractMultiset
AbstractMultiset.ElementSet, AbstractMultiset.EntrySet
-
Nested classes/interfaces inherited from interface com.google.common.collect.Multiset
Multiset.Entry<E>
-
-
Field Summary
-
Fields inherited from class com.google.common.collect.Multimaps.Keys
multimap
-
-
Constructor Summary
Constructors Constructor Description Keys()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<Multiset.Entry<K>>
entrySet()
Returns a view of the contents of this multiset, grouped intoMultiset.Entry
instances, each providing an element of the multiset and the count of that element.int
remove(java.lang.Object key, int occurrences)
Removes a number of occurrences of the specified element from this multiset.-
Methods inherited from class com.google.common.collect.Multimaps.Keys
clear, contains, count, createEntrySet, distinctElements, elementSet, entryIterator, iterator
-
Methods inherited from class com.google.common.collect.AbstractMultiset
add, add, addAll, createElementSet, equals, hashCode, isEmpty, remove, removeAll, retainAll, setCount, setCount, size, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray, toArray, toArray
-
Methods inherited from interface com.google.common.collect.Multiset
containsAll
-
-
-
-
Method Detail
-
remove
public int remove(@Nullable java.lang.Object key, int occurrences)
Description copied from interface:Multiset
Removes a number of occurrences of the specified element from this multiset. If the multiset contains fewer than this number of occurrences to begin with, all occurrences will be removed. Note that ifoccurrences == 1
, this is functionally equivalent to the callremove(element)
.- Specified by:
remove
in interfaceMultiset<K>
- Overrides:
remove
in classMultimaps.Keys<K,V>
- Parameters:
key
- the element to conditionally remove occurrences ofoccurrences
- the number of occurrences of the element to remove. May be zero, in which case no change will be made.- Returns:
- the count of the element before the operation; possibly zero
-
entrySet
public java.util.Set<Multiset.Entry<K>> entrySet()
Description copied from interface:Multiset
Returns a view of the contents of this multiset, grouped intoMultiset.Entry
instances, each providing an element of the multiset and the count of that element. This set contains exactly one entry for each distinct element in the multiset (thus it always has the same size as theMultiset.elementSet()
). The order of the elements in the element set is unspecified.The entry set is backed by the same data as the multiset, so any change to either is immediately reflected in the other. However, multiset changes may or may not be reflected in any
Entry
instances already retrieved from the entry set (this is implementation-dependent). Furthermore, implementations are not required to support modifications to the entry set at all, and theEntry
instances themselves don't even have methods for modification. See the specific implementation class for more details on how its entry set handles modifications.
-
-