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

org.rrd4j.data.PDef Maven / Gradle / Ivy

Go to download

A high performance data logging and graphing system for time series data.

There is a newer version: 3.9
Show newest version
package org.rrd4j.data;

class PDef extends Source implements NonRrdSource  {
    private final Plottable plottable;

    PDef(String name, Plottable plottable) {
        super(name);
        this.plottable = plottable;
    }

    /** {@inheritDoc} */
    public void calculate(long tStart, long tEnd, DataProcessor dataProcessor) {
        long[] times = getTimestamps();
        double[] vals = new double[times.length];
        for (int i = 0; i < times.length; i++) {
            vals[i] = plottable.getValue(times[i]);
        }
        setValues(vals);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy