Example usage for Java com.google.common.collect Multiset fields, constructors, methods, implement or subclass
The text is from its open source code.
boolean | add(E element) Adds a single occurrence of the specified element to this multiset. |
int | add(@Nullable E element, int occurrences) Adds a number of occurrences of an element to this multiset. |
boolean | addAll(Collection extends E> c) Adds all of the elements in the specified collection to this collection (optional operation). |
void | clear() Removes all of the elements from this collection (optional operation). |
boolean | contains(@Nullable Object element) Determines whether this multiset contains the specified element. |
int | count(@Nullable Object element) Returns the number of occurrences of an element in this multiset (the count of the element). |
Set | elementSet() 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. |
boolean | equals(@Nullable Object object) Compares the specified object with this multiset for equality. |
int | hashCode() Returns the hash code for this multiset. |
boolean | isEmpty() Returns true if this collection contains no elements. |
Iterator | iterator() Elements that occur multiple times in the multiset will appear multiple times in this iterator, though not necessarily sequentially. |
boolean | remove(@Nullable Object element) Removes a single occurrence of the specified element from this multiset, if present. |
int | remove(@Nullable Object element, int occurrences) Removes a number of occurrences of the specified element from this multiset. |
boolean | removeAll(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. |
boolean | retainAll(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. |
int | setCount(E element, int count) Adds or removes the necessary occurrences of an element such that the element attains the desired count. |
int | size() Returns the number of elements in this collection. |
Stream | stream() 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. |
String | toString() 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] . |