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>,java.lang.Iterable<E>,java.util.Collection<E>
- Direct Known Subclasses:
Multisets.FilteredMultiset
- Enclosing class:
- Multisets
private abstract static class Multisets.ViewMultiset<E> extends AbstractMultiset<E>
AnAbstractMultisetwith additional default implementations, some of them linear-time implementations in terms ofelementSetandentrySet.
-
-
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 Modifier Constructor Description privateViewMultiset()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()(package private) intdistinctElements()java.util.Iterator<E>iterator()intsize()Returns the total number of all occurrences of all elements in this multiset.-
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.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
-
-
-
-
Method Detail
-
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().
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Collection<E>- Specified by:
clearin classAbstractMultiset<E>
-
iterator
public java.util.Iterator<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>
-
-