Multiset whose contents will never change, with many other important properties
detailed at ImmutableCollection.
Grouped iteration. In all current implementations, duplicate elements always appear consecutively when iterating. Elements iterate in order by the first appearance of that element when the multiset was created.
See the Guava User Guide article on immutable collections.
| Modifier and Type | Class and Description |
|---|---|
| public static class | ImmutableMultiset.
A builder for creating immutable multiset instances, especially |
| pack-priv static class | |
| private class | |
| pack-priv static class | |
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private transient ImmutableList | |
| private transient ImmutableSet | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public final int | add(E
the element to add occurrences of; may be null only if explicitly allowed by the
implementation element, int the number of occurrences of the element to add. May be zero, in which case
no change will be made. occurrences)Implements com.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the collection unmodified.
|
| public ImmutableList | asList()
Overrides com. ImmutableList containing the same elements, in the same order, as this
collection.
|
| public static <E> ImmutableMultiset. | |
| public boolean | contains(Object
the element to check for object)Implements abstract com. Implements com. |
| private static <E> ImmutableMultiset | |
| pack-priv static <E> ImmutableMultiset | |
| pack-priv int | |
| public static <E> ImmutableMultiset | copyOf(E[] elements)
Returns an immutable multiset containing the given elements, in the "grouped iteration order" described in the class documentation. |
| public static <E> ImmutableMultiset | |
| public static <E> ImmutableMultiset | |
| private ImmutableSet | |
| public abstract ImmutableSet | elementSet()
Redeclares com. |
| public ImmutableSet | entrySet()
Implements com. Multiset.Entry instances,
each providing an element of the multiset and the count of that element.
|
| public boolean | equals(Object
object to be compared for equality with this collection object)Overrides java. Implements com. |
| pack-priv abstract Multiset. | |
| public int | hashCode()
Overrides java. Implements com. |
| public UnmodifiableIterator | iterator()
Implements abstract com. Implements com. |
| public static <E> ImmutableMultiset | |
| public static <E> ImmutableMultiset | |
| public static <E> ImmutableMultiset | |
| public static <E> ImmutableMultiset | of(E e1, E e2, E e3)
Returns an immutable multiset containing the given elements, in the "grouped iteration order" described in the class documentation. |
| public static <E> ImmutableMultiset | of(E e1, E e2, E e3, E e4)
Returns an immutable multiset containing the given elements, in the "grouped iteration order" described in the class documentation. |
| public static <E> ImmutableMultiset | of(E e1, E e2, E e3, E e4, E e5)
Returns an immutable multiset containing the given elements, in the "grouped iteration order" described in the class documentation. |
| public static <E> ImmutableMultiset | of(E e1, E e2, E e3, E e4, E e5, E e6, E... others)
Returns an immutable multiset containing the given elements, in the "grouped iteration order" described in the class documentation. |
| private void | |
| public final int | remove(Object
the element to conditionally remove occurrences of element, int the number of occurrences of the element to remove. May be zero, in which
case no change will be made. occurrences)Implements com.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the collection unmodified.
|
| public final int | setCount(E
the element to add or remove occurrences of; may be null only if explicitly
allowed by the implementation element, int the desired count of the element in this multiset count)Implements com.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the collection unmodified.
|
| public final boolean | setCount(E
the element to conditionally set the count of; may be null only if explicitly
allowed by the implementation element, int the expected present count of the element in this multiset oldCount, int the desired count of the element in this multiset newCount)Implements com.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the collection unmodified.
|
| public static <E> Collector | toImmutableMultiset()
Returns a |
| public static <T extends @Nullable Object, E> Collector | toImmutableMultiset(Function<? super T, ? extends E> elementFunction, ToIntFunction<? super T> countFunction)
Returns a |
| public String | toString()
Overrides java. Implements com. It is recommended, though not mandatory, that this method return the result of invoking
|
| pack-priv Object |