Java com.google.common.collect Multiset fields, constructors, methods, implement or subclass

Example usage for Java com.google.common.collect Multiset fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for com.google.common.collect Multiset.

The text is from its open source code.

Implementation

com.google.common.collect.Multiset has the following implementations.
Click this link to see all its implementation.

Method

booleanadd(E element)
Adds a single occurrence of the specified element to this multiset.
intadd(@Nullable E element, int occurrences)
Adds a number of occurrences of an element to this multiset.
booleanaddAll(Collection c)
Adds all of the elements in the specified collection to this collection (optional operation).
voidclear()
Removes all of the elements from this collection (optional operation).
booleancontains(@Nullable Object element)
Determines whether this multiset contains the specified element.
intcount(@Nullable Object element)
Returns the number of occurrences of an element in this multiset (the count of the element).
SetelementSet()
Returns the set of distinct elements contained in this multiset.
Set>entrySet()
Returns a view of the contents of this multiset, grouped into Multiset.Entry instances, each providing an element of the multiset and the count of that element.
booleanequals(@Nullable Object object)
Compares the specified object with this multiset for equality.
inthashCode()
Returns the hash code for this multiset.
booleanisEmpty()
Returns true if this collection contains no elements.
Iteratoriterator()

Elements that occur multiple times in the multiset will appear multiple times in this iterator, though not necessarily sequentially.

booleanremove(@Nullable Object element)
Removes a single occurrence of the specified element from this multiset, if present.
intremove(@Nullable Object element, int occurrences)
Removes a number of occurrences of the specified element from this multiset.
booleanremoveAll(Collection c)

Note: This method ignores how often any element might appear in c , and only cares whether or not an element appears at all.

booleanretainAll(Collection c)

Note: This method ignores how often any element might appear in c , and only cares whether or not an element appears at all.

intsetCount(E element, int count)
Adds or removes the necessary occurrences of an element such that the element attains the desired count.
intsize()
Returns the number of elements in this collection.
Streamstream()
Returns a sequential Stream with this collection as its source.
T[]toArray(T[] a)
Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.
StringtoString()

It is recommended, though not mandatory, that this method return the result of invoking #toString on the #entrySet , yielding a result such as [a x 3, c, d x 2, e] .