Uses of Interface
com.google.common.collect.Multiset
-
Packages that use Multiset Package Description com.google.common.collect This package contains generic collection interfaces and implementations, and other utilities for working with collections. -
-
Uses of Multiset in com.google.common.collect
Subinterfaces of Multiset in com.google.common.collect Modifier and Type Interface Description interface
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
com.google.common.collect.SortedMultisetBridge<E extends @Nullable Object>
Superinterface ofSortedMultiset
to introduce a bridge method forelementSet()
, to ensure binary compatibility with older Guava versions that specifiedelementSet()
to returnSortedSet
.Classes in com.google.common.collect that implement Multiset Modifier and Type Class Description class
ConcurrentHashMultiset<E>
A multiset that supports concurrent modifications and that provides atomic versions of mostMultiset
operations (exceptions where noted).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
ForwardingSortedMultiset.StandardDescendingMultiset
A skeleton implementation of a descending multiset view.class
HashMultiset<E extends @Nullable Object>
Multiset implementation backed by aHashMap
.class
ImmutableMultiset<E>
AMultiset
whose contents will never change, with many other important properties detailed atImmutableCollection
.class
ImmutableSortedMultiset<E>
ASortedMultiset
whose contents will never change, with many other important properties detailed atImmutableCollection
.class
LinkedHashMultiset<E extends @Nullable Object>
AMultiset
implementation with predictable iteration order.class
TreeMultiset<E extends @Nullable Object>
A multiset which maintains the ordering of its elements, according to either their natural order or an explicitComparator
.Methods in com.google.common.collect with type parameters of type Multiset Modifier and Type Method Description static <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.Methods in com.google.common.collect that return Multiset Modifier and Type Method Description protected abstract Multiset<E>
ForwardingMultiset. delegate()
static <E extends @Nullable Object>
Multiset<E>Multisets. difference(Multiset<E> multiset1, Multiset<?> multiset2)
Returns an unmodifiable view of the difference of two multisets.static <E extends @Nullable Object>
Multiset<E>Multisets. filter(Multiset<E> unfiltered, Predicate<? super E> predicate)
Returns a view of the elements ofunfiltered
that satisfy a predicate.static <E extends @Nullable Object>
Multiset<E>Multisets. intersection(Multiset<E> multiset1, Multiset<?> multiset2)
Returns an unmodifiable view of the intersection of two multisets.Multiset<K>
ForwardingMultimap. keys()
Multiset<K>
Multimap. keys()
Returns a view collection containing the key from each key-value pair in this multimap, without collapsing duplicates.static <E extends @Nullable Object>
Multiset<E>Multisets. sum(Multiset<? extends E> multiset1, Multiset<? extends E> multiset2)
Returns an unmodifiable view of the sum of two multisets.static <E extends @Nullable Object>
Multiset<E>Multisets. union(Multiset<? extends E> multiset1, Multiset<? extends E> multiset2)
Returns an unmodifiable view of the union of two multisets.static <E> Multiset<E>
Multisets. unmodifiableMultiset(ImmutableMultiset<E> multiset)
Deprecated.no need to use thisstatic <E extends @Nullable Object>
Multiset<E>Multisets. unmodifiableMultiset(Multiset<? extends E> multiset)
Returns an unmodifiable view of the specified multiset.Methods in com.google.common.collect with parameters of type Multiset Modifier and Type Method Description static 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 is highest count first, with ties broken by the iteration order of the original multiset.static <E extends @Nullable Object>
Multiset<E>Multisets. difference(Multiset<E> multiset1, Multiset<?> multiset2)
Returns an unmodifiable view of the difference of two multisets.static <E extends @Nullable Object>
Multiset<E>Multisets. filter(Multiset<E> unfiltered, Predicate<? super E> predicate)
Returns a view of the elements ofunfiltered
that satisfy a predicate.static <E extends @Nullable Object>
Multiset<E>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)
.static <E extends @Nullable Object>
Multiset<E>Multisets. sum(Multiset<? extends E> multiset1, Multiset<? extends E> multiset2)
Returns an unmodifiable view of the sum of two multisets.static <E extends @Nullable Object>
Multiset<E>Multisets. union(Multiset<? extends E> multiset1, Multiset<? extends E> multiset2)
Returns an unmodifiable view of the union of two multisets.static <E extends @Nullable Object>
Multiset<E>Multisets. unmodifiableMultiset(Multiset<? extends E> multiset)
Returns an unmodifiable view of the specified multiset.
-