Package org.openjdk.jmh.util
Class DelegatingMultiset<T>
- java.lang.Object
-
- org.openjdk.jmh.util.DelegatingMultiset<T>
-
- All Implemented Interfaces:
java.io.Serializable,Multiset<T>
- Direct Known Subclasses:
HashMultiset,TreeMultiset
public class DelegatingMultiset<T> extends java.lang.Object implements Multiset<T>, java.io.Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<T,java.lang.Long>mapprivate static longserialVersionUIDprivate longsize
-
Constructor Summary
Constructors Constructor Description DelegatingMultiset(java.util.Map<T,java.lang.Long> map)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(T element)Add the element to the multisetvoidadd(T element, long add)Add the element to the multisetlongcount(T element)Count the elements in multisetjava.util.Collection<java.util.Map.Entry<T,java.lang.Long>>entrySet()Get all associations of the multiset.booleanequals(java.lang.Object o)inthashCode()booleanisEmpty()Answers if Multiset is emptyjava.util.Collection<T>keys()Answers the collection of keyslongsize()Answers the size of multiset.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
map
protected final java.util.Map<T,java.lang.Long> map
-
size
private long size
-
-
Constructor Detail
-
DelegatingMultiset
public DelegatingMultiset(java.util.Map<T,java.lang.Long> map)
-
-
Method Detail
-
add
public void add(T element)
Description copied from interface:MultisetAdd the element to the multiset
-
add
public void add(T element, long add)
Description copied from interface:MultisetAdd the element to the multiset
-
count
public long count(T element)
Description copied from interface:MultisetCount the elements in multiset
-
entrySet
public java.util.Collection<java.util.Map.Entry<T,java.lang.Long>> entrySet()
Description copied from interface:MultisetGet all associations of the multiset. Each entry provides a key and a count of that element.
-
isEmpty
public boolean isEmpty()
Description copied from interface:MultisetAnswers if Multiset is empty
-
size
public long size()
Description copied from interface:MultisetAnswers the size of multiset. Equivalent to number of elements, counting duplications.
-
keys
public java.util.Collection<T> keys()
Description copied from interface:MultisetAnswers the collection of keys
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-