Package com.google.common.collect
Class Multisets.ViewMultiset<E>
java.lang.Object
java.util.AbstractCollection<E>
com.google.common.collect.AbstractMultiset<E>
com.google.common.collect.Multisets.ViewMultiset<E>
- All Implemented Interfaces:
Multiset<E>
,Iterable<E>
,Collection<E>
- Direct Known Subclasses:
Multisets.FilteredMultiset
- Enclosing class:
Multisets
An
AbstractMultiset
with additional default implementations, some of them linear-time
implementations in terms of elementSet
and entrySet
.-
Nested Class Summary
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>
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.google.common.collect.AbstractMultiset
add, add, addAll, contains, createElementSet, createEntrySet, elementIterator, elementSet, entryIterator, entrySet, equals, hashCode, isEmpty, remove, remove, removeAll, retainAll, setCount, setCount, toString
Methods inherited from class java.util.AbstractCollection
containsAll, toArray, toArray
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray, toArray, toArray
Methods inherited from interface com.google.common.collect.Multiset
containsAll, count, forEach, forEachEntry, spliterator
-
Constructor Details
-
ViewMultiset
private ViewMultiset()
-
-
Method Details
-
size
public int size()Description copied from interface:Multiset
Returns the total number of all occurrences of all elements in this multiset.Note: this method does not return the number of distinct elements in the multiset, which is given by
entrySet().size()
.- Specified by:
size
in interfaceCollection<E>
- Specified by:
size
in interfaceMultiset<E>
- Specified by:
size
in classAbstractCollection<E>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<E>
- Specified by:
clear
in classAbstractMultiset<E>
-
iterator
Description copied from interface:Multiset
Elements that occur multiple times in the multiset will appear multiple times in this iterator, though not necessarily sequentially.
-
distinctElements
int distinctElements()- Specified by:
distinctElements
in classAbstractMultiset<E>
-