kcl.waterloo.graphics.data
Class GJXYSeries
- java.lang.Object
-
- kcl.waterloo.graphics.data.GJXYSeries
-
public class GJXYSeries extends java.lang.ObjectClass for representing paired x,y data as ArrayListlists of equal length. The x, y data are immutable - getX() and getY() methods return copies. There is no public null constructor. To serialize this class to XML with the beans encoder, define a custom persistence delegate, e.g.: <@code xmlencoder.setPersistenceDelegate(GJXYSeries.class, new DefaultPersistenceDelegate(new String[]{"x", "y"}));>
-
-
Constructor Summary
Constructors Constructor and Description GJXYSeries(java.util.ArrayList<java.util.ArrayList<java.lang.Double>> xy)GJXYSeries(java.util.ArrayList<java.lang.Double> x, java.util.ArrayList<java.lang.Double> y)Set x and y.GJXYSeries(double[] x, double[] y)Creates an instance by forming ArrayLists from the inputs.GJXYSeries(java.lang.Double[] x, java.lang.Double[] y)Creates an instance by forming ArrayLists from the inputs.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static voidassertSameLength(java.util.ArrayList<java.lang.Double> x, java.util.ArrayList<java.lang.Double> y)doublegetCenterX()doublegetCenterY()doublegetMaxX()doublegetMaxY()doublegetMinX()doublegetMinY()java.util.ArrayList<java.lang.Double>getX()Returns a copy of the x-datajava.util.ArrayList<java.lang.Double>getY()Returns a copy of the y dataintsize()Size of the x & y vectors.
-
-
-
Constructor Detail
-
GJXYSeries
public GJXYSeries(java.util.ArrayList<java.lang.Double> x, java.util.ArrayList<java.lang.Double> y)Set x and y. These are copied by reference so the capacity to maintain an external reference to the ArrayLists is preserved if that is needed. To avoid that, provide a temporary copy of the ArrayLists as input. Asserts ArrayIndexOutOfBoundsException if x and y are not the same size.- Parameters:
x- ArrayListcopied by reference from the input y- ArrayListcopied by reference from the input
-
GJXYSeries
public GJXYSeries(java.util.ArrayList<java.util.ArrayList<java.lang.Double>> xy)
-
GJXYSeries
public GJXYSeries(java.lang.Double[] x, java.lang.Double[] y)Creates an instance by forming ArrayLists from the inputs.- Parameters:
x- Double[]y- Double[]
-
GJXYSeries
public GJXYSeries(double[] x, double[] y)Creates an instance by forming ArrayLists from the inputs.- Parameters:
x- double[]y- double[]
-
-
Method Detail
-
size
public int size()
Size of the x & y vectors.- Returns:
- the size
-
getX
public java.util.ArrayList<java.lang.Double> getX()
Returns a copy of the x-data- Returns:
- the x
-
getY
public java.util.ArrayList<java.lang.Double> getY()
Returns a copy of the y data- Returns:
- the y
-
getMinX
public double getMinX()
-
getMaxX
public double getMaxX()
-
getMinY
public double getMinY()
-
getMaxY
public double getMaxY()
-
getCenterX
public double getCenterX()
-
getCenterY
public double getCenterY()
-
assertSameLength
public static void assertSameLength(java.util.ArrayList<java.lang.Double> x, java.util.ArrayList<java.lang.Double> y)
-
-
DMelt 3.0 © DataMelt by jWork.ORG