T
- Type of object for histogram.public class ObjectHistogram<T> extends Object implements Histogram<T,ObjectHistogram<T>>, DistributionComputer
Histogram
that implements also DistributionComputer
.Constructor and Description |
---|
ObjectHistogram(IgniteFunction<T,Integer> bucketMapping,
IgniteFunction<T,Double> mappingToCntr)
Create an instance of 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
|
ObjectHistogram<T> |
plus(ObjectHistogram<T> other) |
public ObjectHistogram(IgniteFunction<T,Integer> bucketMapping, IgniteFunction<T,Double> mappingToCntr)
bucketMapping
- Bucket mapping.mappingToCntr
- Mapping to counter.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.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019