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.EntrySetNested 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, toStringMethods inherited from class java.util.AbstractCollection
containsAll, toArray, toArrayMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray, toArray, toArrayMethods 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:MultisetReturns 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:
sizein interfaceCollection<E>- Specified by:
sizein interfaceMultiset<E>- Specified by:
sizein classAbstractCollection<E>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<E>- Specified by:
clearin classAbstractMultiset<E>
-
iterator
Description copied from interface:MultisetElements that occur multiple times in the multiset will appear multiple times in this iterator, though not necessarily sequentially.
-
distinctElements
int distinctElements()- Specified by:
distinctElementsin classAbstractMultiset<E>
-