/** * Method overriden from the base class. This method will be called by the framework. Call * this method only if you need spline-interpolated values in your code. * * @param timestamp timestamp in seconds * @return inteprolated datasource value */ public double getValue(long timestamp) { return getValue((double) timestamp); }
/** * Creates cubic spline interpolator for an array of 2D-points. * * @param x x-axis point coordinates * @param y y-axis point coordinates * @throws RrdException Thrown if supplied arrays do not contain at least 3 values, or if * timestamps are not ordered, or array lengths are not equal, or some datasource value is NaN. */ public CubicSplineInterpolator(double[] x, double[] y) throws RrdException { this.x = x; this.y = y; validate(); spline(); }
/** * Creates cubic spline interpolator from arrays of timestamps and corresponding * datasource values. * * @param timestamps timestamps in seconds * @param values corresponding datasource values * @throws RrdException Thrown if supplied arrays do not contain at least 3 values, or if * timestamps are not ordered, or array lengths are not equal, or some datasource value is NaN. */ public CubicSplineInterpolator(long[] timestamps, double[] values) throws RrdException { this.x = new double[timestamps.length]; for (int i = 0; i < timestamps.length; i++) { this.x[i] = timestamps[i]; } this.y = values; validate(); spline(); }
/** * Method overriden from the base class. This method will be called by the framework. Call * this method only if you need spline-interpolated values in your code. * * @param timestamp timestamp in seconds * @return inteprolated datasource value */ public double getValue(long timestamp) { return getValue((double) timestamp); }
/** * Creates cubic spline interpolator from arrays of Date objects and corresponding * datasource values. * * @param dates Array of Date objects * @param values corresponding datasource values * @throws RrdException Thrown if supplied arrays do not contain at least 3 values, or if * timestamps are not ordered, or array lengths are not equal, or some datasource value is NaN. */ public CubicSplineInterpolator(Date[] dates, double[] values) throws RrdException { this.x = new double[dates.length]; for (int i = 0; i < dates.length; i++) { this.x[i] = Util.getTimestamp(dates[i]); } this.y = values; validate(); spline(); }
/** * Creates cubic spline interpolator from arrays of GregorianCalendar objects and corresponding * datasource values. * * @param dates Array of GregorianCalendar objects * @param values corresponding datasource values * @throws RrdException Thrown if supplied arrays do not contain at least 3 values, or if * timestamps are not ordered, or array lengths are not equal, or some datasource value is NaN. */ public CubicSplineInterpolator(Calendar[] dates, double[] values) throws RrdException { this.x = new double[dates.length]; for (int i = 0; i < dates.length; i++) { this.x[i] = Util.getTimestamp(dates[i]); } this.y = values; validate(); spline(); }
/** * Creates cubic spline interpolator for an array of 2D-points. * * @param x x-axis point coordinates * @param y y-axis point coordinates * @throws RrdException Thrown if supplied arrays do not contain at least 3 values, or if * timestamps are not ordered, or array lengths are not equal, or some datasource value is NaN. */ public CubicSplineInterpolator(double[] x, double[] y) throws RrdException { this.x = x; this.y = y; validate(); spline(); }
/** * Creates cubic spline interpolator from arrays of timestamps and corresponding * datasource values. * * @param timestamps timestamps in seconds * @param values corresponding datasource values * @throws RrdException Thrown if supplied arrays do not contain at least 3 values, or if * timestamps are not ordered, or array lengths are not equal, or some datasource value is NaN. */ public CubicSplineInterpolator(long[] timestamps, double[] values) throws RrdException { this.x = new double[timestamps.length]; for (int i = 0; i < timestamps.length; i++) { this.x[i] = timestamps[i]; } this.y = values; validate(); spline(); }
/** * Creates cubic spline interpolator from arrays of GregorianCalendar objects and corresponding * datasource values. * * @param dates Array of GregorianCalendar objects * @param values corresponding datasource values * @throws RrdException Thrown if supplied arrays do not contain at least 3 values, or if * timestamps are not ordered, or array lengths are not equal, or some datasource value is NaN. */ public CubicSplineInterpolator(Calendar[] dates, double[] values) throws RrdException { this.x = new double[dates.length]; for (int i = 0; i < dates.length; i++) { this.x[i] = Util.getTimestamp(dates[i]); } this.y = values; validate(); spline(); }
/** * Creates cubic spline interpolator from arrays of Date objects and corresponding * datasource values. * * @param dates Array of Date objects * @param values corresponding datasource values * @throws RrdException Thrown if supplied arrays do not contain at least 3 values, or if * timestamps are not ordered, or array lengths are not equal, or some datasource value is NaN. */ public CubicSplineInterpolator(Date[] dates, double[] values) throws RrdException { this.x = new double[dates.length]; for (int i = 0; i < dates.length; i++) { this.x[i] = Util.getTimestamp(dates[i]); } this.y = values; validate(); spline(); }