com.datastax.data.exploration.biz.stat.histogram.IntegerHistogram Maven / Gradle / Ivy
The newest version!
package com.datastax.data.exploration.biz.stat.histogram;
import com.datastax.data.exploration.biz.datatable.column.IntegerColumn;
public class IntegerHistogram extends HistogramStat {
public IntegerHistogram(IntegerColumn column) {
super(column);
this.max = column.getStat().max();
this.min = column.getStat().min();
this.list = column.getNotNullValues();
}
@Override
int count(double start, double end, boolean last) {
if (last)
return (int) list.stream().filter(v -> (v >= start && v <= end)).count();
return (int) list.stream().filter(v -> (v >= start && v < end)).count();
}
}