ifi.dsb
Class CurveData

java.lang.Object
  extended byifi.dsb.CurveData

public class CurveData
extends java.lang.Object

Class to hold data coordinates for a curve, along one axis. The coordinate values are copied to an internal storage buffer.

Implementation note: The double-precision floating point data values are scaled and converted into an integer-valued array of the same length. The integer values are pixel coordinates.

Author:
Svein Bøe, svein@ifi.uio.no, 2002 - 2003.
See Also:
Curve, Axis, Graph, Plot2D

Constructor Summary
CurveData(Axis axis, Curve curve, double[] data)
          Constructs CurveData object.
CurveData(Axis axis, Curve curve, double[] data, int n)
          Constructs CurveData object.
CurveData(Plot2D plot, Curve curve, double[] data, int orientation)
          Construct CurveData object.
 
Method Summary
 Curve getCurve()
          Return reference to the curve this data belongs to.
 double[] getData()
          Return reference to data values.
 int indexMax(double max)
          Maximum data index where data values are at least as small as the parameter value.
 int indexMin(double min)
          Minimum data index where data value is at least as large as the parameter value.
 void printDataArray()
          Print the double-precision floating-point array.
 void printIntArray()
          Print the scaled integer array.
 void setCurve(Curve curve)
          Set reference to the curve this data belongs to.
 void updateIntArray()
          Update the scaled integer array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CurveData

public CurveData(Plot2D plot,
                 Curve curve,
                 double[] data,
                 int orientation)
Construct CurveData object. Update axis minimum/maximum unless they have been set to be fixed.

Parameters:
plot - Plot where the curve-data will appear.
curve - The curve this data belongs to.
data - Curve coordinate values along the axis. The array is copied to an internal storage buffer.
orientation - Axis.VERTICAL or Axis.HORIZONTAL to tell which axis the data are for.

CurveData

public CurveData(Axis axis,
                 Curve curve,
                 double[] data)
Constructs CurveData object. Update axis minimum/maximum unless they have been set to be fixed.

Parameters:
axis - Axis which this data belongs to.
curve - The curve this data belongs to.
data - Curve coordinate values along the axis. The array is copied to an internal storage buffer.

CurveData

public CurveData(Axis axis,
                 Curve curve,
                 double[] data,
                 int n)
Constructs CurveData object. Update axis minimum/maximum unless they have been set to be fixed.

Parameters:
axis - Axis for this data.
curve - The curve this data belongs to.
data - Curve coordinate values along the axis. The array is copied to an internal storage buffer.
n - Number of data samples to copy (starting with the first).
Method Detail

getCurve

public Curve getCurve()
Return reference to the curve this data belongs to.


setCurve

public void setCurve(Curve curve)
Set reference to the curve this data belongs to.


getData

public double[] getData()
Return reference to data values.


indexMin

public int indexMin(double min)
Minimum data index where data value is at least as large as the parameter value.

Parameters:
min - Typically axis minimum.

indexMax

public int indexMax(double max)
Maximum data index where data values are at least as small as the parameter value.

Parameters:
max - Typically axis maximum.

updateIntArray

public void updateIntArray()
Update the scaled integer array.


printIntArray

public void printIntArray()
Print the scaled integer array.


printDataArray

public void printDataArray()
Print the double-precision floating-point array.