class FilteredEntryMultimap.Keys extends Multimaps.Keys<K,V>
AbstractMultiset.ElementSet, AbstractMultiset.EntrySet
Multiset.Entry<E>
multimap
Constructor and Description |
---|
Keys() |
Modifier and Type | Method and Description |
---|---|
java.util.Set<Multiset.Entry<K>> |
entrySet()
Returns a view of the contents of this multiset, grouped into
Multiset.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.
|
clear, contains, count, distinctElements, elementIterator, elementSet, entryIterator, forEach, iterator, size, spliterator
add, add, addAll, createElementSet, createEntrySet, equals, hashCode, isEmpty, remove, removeAll, retainAll, setCount, setCount, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, forEachEntry
public int remove(@CheckForNull java.lang.Object key, int occurrences)
Multiset
occurrences == 1
, this is functionally equivalent to the call remove(element)
.remove
in interface Multiset<K>
remove
in class Multimaps.Keys<K,V>
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.public java.util.Set<Multiset.Entry<K>> entrySet()
Multiset
Multiset.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 the Multiset.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 the Entry
instances themselves don't even
have methods for modification. See the specific implementation class for more details on how
its entry set handles modifications.