|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jrobin.graph.Plottable
org.jrobin.graph.CubicSplineInterpolator
Class used to interpolate datasource values from the collection of (timestamp, values) points using natural cubic spline interpolation.
WARNING: So far, this class cannot handle NaN datasource values
(an exception will be thrown by the constructor). Future releases might change this.
Pass instances of this class to RrdGraphDef.datasource() to provide spline-interpolated datasource values to JRobin grapher.
| Constructor Summary | |
CubicSplineInterpolator(java.util.Date[] dates,
double[] values)
Creates cubic spline interpolator from arrays of Date objects and corresponding datasource values. |
|
CubicSplineInterpolator(double[] x,
double[] y)
Creates cubic spline interpolator for an array of 2D-points. |
|
CubicSplineInterpolator(java.util.GregorianCalendar[] dates,
double[] values)
Creates cubic spline interpolator from arrays of GregorianCalendar objects and corresponding datasource values. |
|
CubicSplineInterpolator(long[] timestamps,
double[] values)
Creates cubic spline interpolator from arrays of timestamps and corresponding datasource values. |
|
| Method Summary | |
double |
getValue(double xval)
Calculates spline-interpolated y-value for the corresponding x-value. |
double |
getValue(long timestamp)
Method overriden from the base class. |
| Methods inherited from class org.jrobin.graph.Plottable |
getValue, getValue |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CubicSplineInterpolator(long[] timestamps,
double[] values)
throws RrdException
timestamps - timestamps in secondsvalues - corresponding datasource values
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(java.util.Date[] dates,
double[] values)
throws RrdException
dates - Array of Date objectsvalues - corresponding datasource values
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(java.util.GregorianCalendar[] dates,
double[] values)
throws RrdException
dates - Array of GregorianCalendar objectsvalues - corresponding datasource values
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
x - x-axis point coordinatesy - y-axis point coordinates
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.| Method Detail |
public double getValue(double xval)
xval - x-value
public double getValue(long timestamp)
getValue in class Plottabletimestamp - timestamp in seconds
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||