Package elki.math.geometry
Class XYPlot.Curve
- java.lang.Object
-
- elki.math.geometry.XYPlot.Curve
-
- Enclosing class:
- XYPlot
public class XYPlot.Curve extends java.lang.ObjectCurve on this plot.- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classXYPlot.Curve.ItrIterator for the curve. 2D, does not follow Java collections style.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(double x, double y)Add a coordinate pair, but don't simplifyintgetColor()Suggested color number.doublegetX(int off)Curve X value at given positiondoublegetY(int off)Curve Y value at given positionXYPlot.Curve.Itriterator()Get an iterator for the curve.intsize()Size of curve.
-
-
-
Method Detail
-
getColor
public int getColor()
Suggested color number.- Returns:
- Color number
-
add
public void add(double x, double y)Add a coordinate pair, but don't simplify- Parameters:
x- X coordinatey- Y coordinate
-
getX
public double getX(int off)
Curve X value at given position- Parameters:
off- Offset- Returns:
- X value
-
getY
public double getY(int off)
Curve Y value at given position- Parameters:
off- Offset- Returns:
- Y value
-
size
public int size()
Size of curve.- Returns:
- curve length
-
iterator
public XYPlot.Curve.Itr iterator()
Get an iterator for the curve. Note: this is not a Java style iterator, since the only way to get positions is using "next" in Java style. Here, we can have two getters for current values! Instead, use this style of iteration:for (XYCurve.Itr it = curve.iterator(); it.valid(); it.advance()) { doSomethingWith(it.getX(), it.getY()); }- Returns:
- Iterator
-
-