All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.datastax.data.exploration.biz.stat.histogram.IntegerHistogram Maven / Gradle / Ivy

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();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy