@GwtCompatible public final class Multisets extends Object
Multiset
instances.Modifier and Type | Method and Description |
---|---|
static <E> Multiset.Entry<E> |
immutableEntry(E e,
int n)
Returns an immutable multiset entry with the specified element and count.
|
static <E> Multiset<E> |
intersection(Multiset<E> multiset1,
Multiset<?> multiset2)
Returns an unmodifiable view of the intersection of two multisets.
|
static <E> Multiset<E> |
unmodifiableMultiset(Multiset<? extends E> multiset)
Returns an unmodifiable view of the specified multiset.
|
public static <E> Multiset<E> unmodifiableMultiset(Multiset<? extends E> multiset)
UnsupportedOperationException
.
The returned multiset will be serializable if the specified multiset is serializable.
multiset
- the multiset for which an unmodifiable view is to be
generatedpublic static <E> Multiset.Entry<E> immutableEntry(@Nullable E e, int n)
e
- the element to be associated with the returned entryn
- the count to be associated with the returned entryIllegalArgumentException
- if n
is negativepublic static <E> Multiset<E> intersection(Multiset<E> multiset1, Multiset<?> multiset2)
multiset1
, with repeated occurrences of the same
element appearing consecutively.
Results are undefined if multiset1
and multiset2
are
based on different equivalence relations (as HashMultiset
and
TreeMultiset
are).
Copyright © 2010-2012. All Rights Reserved.