Uses of Interface
com.google.common.collect.Multiset
Packages that use Multiset
Package
Description
Collection interfaces and implementations, and other utilities for collections.
-
Uses of Multiset in com.google.common.collect
Subinterfaces of Multiset in com.google.common.collectModifier and TypeInterfaceDescriptioninterfaceSortedMultiset<E extends @Nullable Object>AMultisetwhich maintains the ordering of its elements, according to either their natural order or an explicitComparator.(package private) interfaceSuperinterface ofSortedMultisetto 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 MultisetModifier and TypeClassDescriptionfinal classA multiset that supports concurrent modifications and that provides atomic versions of mostMultisetoperations (exceptions where noted).final classEnumMultiset<E extends Enum<E>>Multiset implementation specialized for enum elements, supporting all single-element operations in O(1).classForwardingMultiset<E extends @Nullable Object>A multiset which forwards all its method calls to another multiset.classForwardingSortedMultiset<E extends @Nullable Object>A sorted multiset which forwards all its method calls to another sorted multiset.protected classA skeleton implementation of a descending multiset view.final classHashMultiset<E extends @Nullable Object>Multiset implementation backed by aHashMap.classAMultisetwhose contents will never change, with many other important properties detailed atImmutableCollection.classASortedMultisetwhose contents will never change, with many other important properties detailed atImmutableCollection.final classLinkedHashMultiset<E extends @Nullable Object>AMultisetimplementation with predictable iteration order.final classTreeMultiset<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 MultisetModifier 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 aCollectorthat accumulates elements into a multiset created via the specifiedSupplier, whose elements are the result of applyingelementFunctionto the inputs, with counts equal to the result of applyingcountFunctionto the inputs.Methods in com.google.common.collect that return MultisetModifier 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 ofunfilteredthat 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.Methods in com.google.common.collect with parameters of type MultisetModifier and TypeMethodDescriptionstatic booleanMultisets.containsOccurrences(Multiset<?> superMultiset, Multiset<?> subMultiset) ReturnstrueifsubMultiset.count(o) <= superMultiset.count(o)for allo.static <E> ImmutableMultiset<E> Multisets.copyHighestCountFirst(Multiset<E> multiset) Returns a copy ofmultisetas anImmutableMultisetwhose 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 ofunfilteredthat satisfy a predicate.Multisets.intersection(Multiset<E> multiset1, Multiset<?> multiset2) Returns an unmodifiable view of the intersection of two multisets.static booleanMultisets.removeOccurrences(Multiset<?> multisetToModify, Multiset<?> occurrencesToRemove) For each occurrence of an elementeinoccurrencesToRemove, removes one occurrence ofeinmultisetToModify.static booleanMultisets.removeOccurrences(Multiset<?> multisetToModify, Iterable<?> occurrencesToRemove) For each occurrence of an elementeinoccurrencesToRemove, removes one occurrence ofeinmultisetToModify.static booleanMultisets.retainOccurrences(Multiset<?> multisetToModify, Multiset<?> multisetToRetain) ModifiesmultisetToModifyso that its count for an elementeis 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.