private abstract static class Multisets.ViewMultiset<E> extends AbstractMultiset<E>
AbstractMultiset
with additional default implementations, some of them linear-time
implementations in terms of elementSet
and entrySet
.AbstractMultiset.ElementSet, AbstractMultiset.EntrySet
Multiset.Entry<E>
Modifier | Constructor and Description |
---|---|
private |
ViewMultiset() |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
(package private) int |
distinctElements() |
java.util.Iterator<E> |
iterator() |
int |
size()
Returns the total number of all occurrences of all elements in this multiset.
|
add, add, addAll, contains, createElementSet, createEntrySet, elementIterator, elementSet, entryIterator, entrySet, equals, hashCode, isEmpty, remove, remove, removeAll, retainAll, setCount, setCount, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, count, forEach, forEachEntry, spliterator
public int size()
Multiset
Note: this method does not return the number of distinct elements in the
multiset, which is given by entrySet().size()
.
public void clear()
clear
in interface java.util.Collection<E>
clear
in class AbstractMultiset<E>
public java.util.Iterator<E> iterator()
Multiset
Elements that occur multiple times in the multiset will appear multiple times in this iterator, though not necessarily sequentially.
int distinctElements()
distinctElements
in class AbstractMultiset<E>