Uses of Interface
com.google.common.collect.Multiset
Package
Description
Collection interfaces and implementations, and other utilities for collections.
-
Uses of Multiset in com.google.common.collect
Modifier and TypeInterfaceDescriptioninterface
SortedMultiset<E extends @Nullable Object>
AMultiset
which maintains the ordering of its elements, according to either their natural order or an explicitComparator
.(package private) interface
Superinterface ofSortedMultiset
to introduce a bridge method forelementSet()
, to ensure binary compatibility with older Guava versions that specifiedelementSet()
to returnSortedSet
.Modifier and TypeClassDescriptionfinal class
A multiset that supports concurrent modifications and that provides atomic versions of mostMultiset
operations (exceptions where noted).final class
EnumMultiset<E extends Enum<E>>
Multiset implementation specialized for enum elements, supporting all single-element operations in O(1).class
ForwardingMultiset<E extends @Nullable Object>
A multiset which forwards all its method calls to another multiset.class
ForwardingSortedMultiset<E extends @Nullable Object>
A sorted multiset which forwards all its method calls to another sorted multiset.protected class
A skeleton implementation of a descending multiset view.final class
HashMultiset<E extends @Nullable Object>
Multiset implementation backed by aHashMap
.class
AMultiset
whose contents will never change, with many other important properties detailed atImmutableCollection
.class
ASortedMultiset
whose contents will never change, with many other important properties detailed atImmutableCollection
.final class
LinkedHashMultiset<E extends @Nullable Object>
AMultiset
implementation with predictable iteration order.final class
TreeMultiset<E extends @Nullable Object>
A multiset which maintains the ordering of its elements, according to either their natural order or an explicitComparator
.Modifier and TypeMethodDescriptionstatic <T extends @Nullable Object,
E extends @Nullable Object, M extends Multiset<E>>
Collector<T, ?, M> Multisets.toMultiset
(Function<? super T, E> elementFunction, ToIntFunction<? super T> countFunction, Supplier<M> multisetSupplier) Returns aCollector
that accumulates elements into a multiset created via the specifiedSupplier
, whose elements are the result of applyingelementFunction
to the inputs, with counts equal to the result of applyingcountFunction
to the inputs.Modifier and TypeMethodDescriptionForwardingMultiset.delegate()
Multisets.difference
(Multiset<E> multiset1, Multiset<?> multiset2) Returns an unmodifiable view of the difference of two multisets.Returns a view of the elements ofunfiltered
that satisfy a predicate.Multisets.intersection
(Multiset<E> multiset1, Multiset<?> multiset2) Returns an unmodifiable view of the intersection of two multisets.ForwardingMultimap.keys()
Multimap.keys()
Returns a view collection containing the key from each key-value pair in this multimap, without collapsing duplicates.Returns an unmodifiable view of the sum of two multisets.Returns an unmodifiable view of the union of two multisets.static <E> Multiset
<E> Multisets.unmodifiableMultiset
(ImmutableMultiset<E> multiset) Deprecated.no need to use thisMultisets.unmodifiableMultiset
(Multiset<? extends E> multiset) Returns an unmodifiable view of the specified multiset.Modifier and TypeMethodDescriptionstatic boolean
Multisets.containsOccurrences
(Multiset<?> superMultiset, Multiset<?> subMultiset) Returnstrue
ifsubMultiset.count(o) <= superMultiset.count(o)
for allo
.static <E> ImmutableMultiset
<E> Multisets.copyHighestCountFirst
(Multiset<E> multiset) Returns a copy ofmultiset
as anImmutableMultiset
whose iteration order puts the highest count first, with ties broken by the iteration order of the original multiset.Multisets.difference
(Multiset<E> multiset1, Multiset<?> multiset2) Returns an unmodifiable view of the difference of two multisets.Returns a view of the elements ofunfiltered
that satisfy a predicate.Multisets.intersection
(Multiset<E> multiset1, Multiset<?> multiset2) Returns an unmodifiable view of the intersection of two multisets.static boolean
Multisets.removeOccurrences
(Multiset<?> multisetToModify, Multiset<?> occurrencesToRemove) For each occurrence of an elemente
inoccurrencesToRemove
, removes one occurrence ofe
inmultisetToModify
.static boolean
Multisets.removeOccurrences
(Multiset<?> multisetToModify, Iterable<?> occurrencesToRemove) For each occurrence of an elemente
inoccurrencesToRemove
, removes one occurrence ofe
inmultisetToModify
.static boolean
Multisets.retainOccurrences
(Multiset<?> multisetToModify, Multiset<?> multisetToRetain) ModifiesmultisetToModify
so that its count for an elemente
is at mostmultisetToRetain.count(e)
.Returns an unmodifiable view of the sum of two multisets.Returns an unmodifiable view of the union of two multisets.Multisets.unmodifiableMultiset
(Multiset<? extends E> multiset) Returns an unmodifiable view of the specified multiset.