Package org.openjdk.jmh.util
Interface Multiset<T>
- Type Parameters:
T
- element type
- All Known Implementing Classes:
DelegatingMultiset
,HashMultiset
,TreeMultiset
public interface Multiset<T>
Basic Multiset.
(Transitional interface)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add the element to the multisetvoid
Add the element to the multisetlong
Count the elements in multisetentrySet()
Get all associations of the multiset.boolean
isEmpty()
Answers if Multiset is emptykeys()
Answers the collection of keyslong
size()
Answers the size of multiset.
-
Method Details
-
add
Add the element to the multiset- Parameters:
element
- element to add
-
add
Add the element to the multiset- Parameters:
element
- element to addcount
- number of elements to add
-
count
Count the elements in multiset- Parameters:
element
- element- Returns:
- number of matching elements in the set; zero, if no elements
-
entrySet
Collection<Map.Entry<T,Long>> entrySet()Get all associations of the multiset. Each entry provides a key and a count of that element.- Returns:
- entry set of the multiset
-
isEmpty
boolean isEmpty()Answers if Multiset is empty- Returns:
- true, if set is empty
-
size
long size()Answers the size of multiset. Equivalent to number of elements, counting duplications.- Returns:
- number of elements
-
keys
Collection<T> keys()Answers the collection of keys- Returns:
- the collections of keys
-