
public class XYCurve extends Object implements Result, TextWriteable
addAndSimplify(double, double) which tries to simplify
 the curve while adding points.| Modifier and Type | Class and Description | 
|---|---|
| class  | XYCurve.ItrIterator for the curve. 2D, does not follow Java collections style. | 
| Modifier and Type | Field and Description | 
|---|---|
| protected gnu.trove.list.array.TDoubleArrayList | dataX and Y positions | 
| protected String | labelxLabel of X axis | 
| protected String | labelyLabel of Y axis | 
| protected double | maxxMinimum and maximum for X axis | 
| protected double | maxyMinimum and maximum for Y axis | 
| protected double | minxMinimum and maximum for X axis | 
| protected double | minyMinimum and maximum for Y axis | 
| protected static double | THRESHOLDSimplification threshold | 
| Constructor and Description | 
|---|
| XYCurve()Constructor. | 
| XYCurve(int size)Constructor with size estimate | 
| XYCurve(String labelx,
       String labely)Constructor with labels | 
| XYCurve(String labelx,
       String labely,
       int size)Constructor with size estimate and labels. | 
| XYCurve(XYCurve curve)Constructor, cloning an existing curve. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | add(double x,
   double y)Add a coordinate pair, but don't simplify | 
| void | addAndSimplify(double x,
              double y)Add a coordinate pair, performing curve simplification if possible. | 
| static double | areaUnderCurve(XYCurve curve)Compute the area under curve for a curve
 monotonously increasing in X. | 
| String | getLabelx()Get label of x axis | 
| String | getLabely()Get label of y axis | 
| String | getLongName()A "pretty" name for the result, for use in titles, captions and menus. | 
| double | getMaxx()Maximum on x axis. | 
| double | getMaxy()Maximum on y axis. | 
| double | getMinx()Minimum on x axis. | 
| double | getMiny()Minimum on y axis. | 
| String | getShortName()A short name for the result, useful for file names. | 
| double | getX(int off)Curve X value at given position | 
| double | getY(int off)Curve Y value at given position | 
| XYCurve.Itr | iterator()Get an iterator for the curve. | 
| int | size()Size of curve. | 
| String | toString() | 
| void | writeToText(TextWriterStream out,
           String label)Write self to the given  TextWriterStream | 
protected static final double THRESHOLD
protected gnu.trove.list.array.TDoubleArrayList data
protected String labelx
protected String labely
protected double minx
protected double maxx
protected double miny
protected double maxy
public XYCurve(String labelx, String labely)
labelx - Label for X axislabely - Label for Y axispublic XYCurve(String labelx, String labely, int size)
labelx - Label for X axislabely - Label for Y axissize - Estimated size (initial allocation size)public XYCurve()
public XYCurve(int size)
size - Estimated size (initial allocation size)public XYCurve(XYCurve curve)
curve - Curve to clone.public void add(double x,
       double y)
x - X coordinatey - Y coordinatepublic void addAndSimplify(double x,
                  double y)
x - X coordinatey - Y coordinatepublic String getLabelx()
public String getLabely()
public double getMinx()
public double getMaxx()
public double getMiny()
public double getMaxy()
public double getX(int off)
off - Offsetpublic double getY(int off)
off - Offsetpublic int size()
public XYCurve.Itr iterator()
for (XYCurve.Itr it = curve.iterator(); it.valid(); it.advance()) { doSomethingWith(it.getX(), it.getY()); }
public void writeToText(TextWriterStream out, String label)
TextWriteableTextWriterStreamwriteToText in interface TextWriteableout - Output writerlabel - Labelpublic String getLongName()
ResultgetLongName in interface Resultpublic String getShortName()
ResultgetShortName in interface Resultpublic static double areaUnderCurve(XYCurve curve)
curve - Curve