/** * Creates LinearInterpolator 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 two values, or if * timestamps are not ordered, or array lengths are not equal. */ public LinearInterpolator(long[] timestamps, double[] values) throws RrdException { this.timestamps = timestamps; this.values = values; validate(); }
/** * Creates LinearInterpolator from arrays of timestamps 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 two values, or if * timestamps are not ordered, or array lengths are not equal. */ public LinearInterpolator(Calendar[] dates, double[] values) throws RrdException { this.values = values; timestamps = new long[dates.length]; for (int i = 0; i < dates.length; i++) { timestamps[i] = Util.getTimestamp(dates[i]); } validate(); }
/** * Creates LinearInterpolator from arrays of timestamps 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 two values, or if * timestamps are not ordered, or array lengths are not equal. */ public LinearInterpolator(Date[] dates, double[] values) throws RrdException { this.values = values; timestamps = new long[dates.length]; for (int i = 0; i < dates.length; i++) { timestamps[i] = Util.getTimestamp(dates[i]); } validate(); }
/** * Creates LinearInterpolator 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 two values, or if * timestamps are not ordered, or array lengths are not equal. */ public LinearInterpolator(long[] timestamps, double[] values) throws RrdException { this.timestamps = timestamps; this.values = values; validate(); }
/** * Creates LinearInterpolator from arrays of timestamps 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 two values, or if * timestamps are not ordered, or array lengths are not equal. */ public LinearInterpolator(Date[] dates, double[] values) throws RrdException { this.values = values; timestamps = new long[dates.length]; for (int i = 0; i < dates.length; i++) { timestamps[i] = Util.getTimestamp(dates[i]); } validate(); }
/** * Creates LinearInterpolator from arrays of timestamps 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 two values, or if * timestamps are not ordered, or array lengths are not equal. */ public LinearInterpolator(Calendar[] dates, double[] values) throws RrdException { this.values = values; timestamps = new long[dates.length]; for (int i = 0; i < dates.length; i++) { timestamps[i] = Util.getTimestamp(dates[i]); } validate(); }