All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class crw.data.Data

java.lang.Object
   |
   +----crw.data.Data

public abstract class Data
extends Object
Abtract class representing the physical data to plot. Its subclasses represent a FunctionData or an ArrayData (from experiement, for example). A Data object is added to a DataWrapper object which really represent all the data to be plotted. A concrete subclass must implement the getX() method which specifies the points of independent x-variable. The x-range and y-range are set in the constructor.

Version:
0.0 3/31/1998
Author:
C.R.Wie

Variable Index

 o xRange

Constructor Index

 o Data()

Method Index

 o getColor()
Returns the plotting color of this data.
 o getFormatP()
 o getNameP()
Returns the Parameter name for display in a parameterized curve family.
 o getParam()
If data is a family of curves, the subclass must override this method and return the parameter values of each curve.
 o getRangeX()
Range is used by other library classes to find the conversion factor, etc.
 o getRangeY()
This method is used by the system to figure the overall y-range from the data, which is used in the Conversion factor, etc.
 o getX()
Must be specified in the concrete subclass.
 o getY()
Is implemented in the subclass FunctionData or ArrayData.
 o init()
initializing subclass variables needed for setting the range (a placeholder method).
 o setColor(Color)
Sets the plotting color for this data.
 o setFormatP(Format)
Sets a new format for parameter display.
 o setNameP(String)
Sets a new parameter name to be displayed.
 o setParam(double[])
Sets a new list of parameter values.
 o setRange()
Calculates and sets the xRange and yRange based on x[] and y[][] data.
 o setXRange(double, double)
Any subclass can use this method to set the xRange.

Variables

 o xRange
 protected FloatRange xRange

Constructors

 o Data
 protected Data()

Methods

 o getX
 public abstract double[] getX()
Must be specified in the concrete subclass.

Returns:
the x-points.
 o getY
 public abstract double[][] getY()
Is implemented in the subclass FunctionData or ArrayData.

Returns:
the y-points (parameterized curve family)
 o getParam
 public double[] getParam()
If data is a family of curves, the subclass must override this method and return the parameter values of each curve. The getY() method the FunctionData class uses this method to get the parameter array, and the DataWrapper class uses it to see if it is a family of curves or a single curve in the DataWrapper.drawFull(g) method.

Returns:
the parameter array for this data.
 o setParam
 public void setParam(double p[])
Sets a new list of parameter values.

Parameters:
p - the new parameter array.
 o getRangeX
 public FloatRange getRangeX()
Range is used by other library classes to find the conversion factor, etc. This info is not needed by client programs.

Returns:
the range of x-values.
 o getRangeY
 public FloatRange getRangeY()
This method is used by the system to figure the overall y-range from the data, which is used in the Conversion factor, etc.

Returns:
the overall y-range.
 o getNameP
 public String getNameP()
Returns the Parameter name for display in a parameterized curve family.

Returns:
the parameter name.
 o setNameP
 public void setNameP(String p)
Sets a new parameter name to be displayed.

Parameters:
new - name for parameter.
 o getFormatP
 public Format getFormatP()
Returns:
the parameter format.
 o setFormatP
 public void setFormatP(Format f)
Sets a new format for parameter display.

Parameters:
f - the new display format for parameter values.
 o getColor
 public Color getColor()
Returns the plotting color of this data. Default color is BLUE.

Returns:
the curve color.
 o setColor
 public void setColor(Color color)
Sets the plotting color for this data.

Parameters:
color - the new plotting color;
 o init
 protected void init()
initializing subclass variables needed for setting the range (a placeholder method).

 o setRange
 protected void setRange()
Calculates and sets the xRange and yRange based on x[] and y[][] data.

 o setXRange
 protected void setXRange(double min,
                          double max)
Any subclass can use this method to set the xRange. for example, setXRange(-13.5, 50.0) sets xRange.min=-13.5, xRange.max=50.0


All Packages  Class Hierarchy  This Package  Previous  Next  Index