T
- Type of object for histogram.public abstract class ObjectHistogram<T> extends Object implements Histogram<T,ObjectHistogram<T>>, DistributionComputer
Histogram
that implements also DistributionComputer
.Constructor and Description |
---|
ObjectHistogram() |
Modifier and Type | Method and Description |
---|---|
void |
addElement(T val)
Add object to histogram.
|
Set<Integer> |
buckets() |
TreeMap<Integer,Double> |
computeDistributionFunction()
Compute distribution function.
|
Optional<Double> |
getValue(Integer bucketId) |
boolean |
isEqualTo(ObjectHistogram<T> other)
Compares histogram with other and returns true if they are equals
|
abstract Integer |
mapToBucket(T obj)
Bucket mapping.
|
abstract Double |
mapToCounter(T obj)
Counter mapping.
|
abstract ObjectHistogram<T> |
newInstance()
Creates an instance of ObjectHistogram from child class.
|
ObjectHistogram<T> |
plus(ObjectHistogram<T> other) |
public void addElement(T val)
addElement
in interface Histogram<T,ObjectHistogram<T>>
val
- Value.public Set<Integer> buckets()
buckets
in interface Histogram<T,ObjectHistogram<T>>
public Optional<Double> getValue(Integer bucketId)
getValue
in interface Histogram<T,ObjectHistogram<T>>
bucketId
- Bucket id.public TreeMap<Integer,Double> computeDistributionFunction()
computeDistributionFunction
in interface DistributionComputer
public ObjectHistogram<T> plus(ObjectHistogram<T> other)
plus
in interface Histogram<T,ObjectHistogram<T>>
other
- Other histogram.public boolean isEqualTo(ObjectHistogram<T> other)
isEqualTo
in interface Histogram<T,ObjectHistogram<T>>
other
- Other histogram.public abstract Integer mapToBucket(T obj)
obj
- Object.public abstract Double mapToCounter(T obj)
obj
- Object.public abstract ObjectHistogram<T> newInstance()
GridGain In-Memory Computing Platform : ver. 8.9.15 Release Date : December 3 2024