@Test public void testToArray() { XYSeries s = new XYSeries("S1"); double[][] array = s.toArray(); assertEquals(2, array.length); assertEquals(0, array[0].length); assertEquals(0, array[1].length); s.add(1.0, 2.0); array = s.toArray(); assertEquals(1, array[0].length); assertEquals(1, array[1].length); assertEquals(2, array.length); assertEquals(1.0, array[0][0], EPSILON); assertEquals(2.0, array[1][0], EPSILON); s.add(2.0, null); array = s.toArray(); assertEquals(2, array.length); assertEquals(2, array[0].length); assertEquals(2, array[1].length); assertEquals(2.0, array[0][1], EPSILON); assertTrue(Double.isNaN(array[1][1])); }
public double[][] toArray() { int itemCount = getItemCount(); double[][] result = new double[2][itemCount]; for (int i = 0; i < itemCount; i++) { result[0][i] = this.getX(i).doubleValue(); Number y = getY(i); if (y != null) { result[1][i] = y.doubleValue(); } else { result[1][i] = Double.NaN; } } return result; }
XYSeries extends Series implements Cloneable, Serializable { public double[][] toArray() { int itemCount = getItemCount(); double[][] result = new double[2][itemCount]; for (int i = 0; i < itemCount; i++) { result[0][i] = this.getX(i).doubleValue(); Number y = getY(i); if (y != null) { result[1][i] = y.doubleValue(); } else { result[1][i] = Double.NaN; } } return result; } }
XYSeries extends Series implements Cloneable, Serializable { public double[][] toArray() { int itemCount = getItemCount(); double[][] result = new double[2][itemCount]; for (int i = 0; i < itemCount; i++) { result[0][i] = this.getX(i).doubleValue(); Number y = getY(i); if (y != null) { result[1][i] = y.doubleValue(); } else { result[1][i] = Double.NaN; } } return result; } XYSeries(Comparable key);  XYSeries(Comparable key, boolean autoSort);  XYSeries(Comparable key, boolean autoSort,
            boolean allowDuplicateXValues); }
XYSeries extends Series implements Cloneable, Serializable { public double[][] toArray() { int itemCount = getItemCount(); double[][] result = new double[2][itemCount]; for (int i = 0; i < itemCount; i++) { result[0][i] = this.getX(i).doubleValue(); Number y = getY(i); if (y != null) { result[1][i] = y.doubleValue(); } else { result[1][i] = Double.NaN; } } return result; } XYSeries(Comparable key);  XYSeries(Comparable key, boolean autoSort);  XYSeries(Comparable key, boolean autoSort,
            boolean allowDuplicateXValues); double getMinX(); double getMaxX(); double getMinY(); double getMaxY(); boolean getAutoSort(); boolean getAllowDuplicateXValues(); @Override int getItemCount(); List<XYDataItem> getItems(); int getMaximumItemCount(); void setMaximumItemCount(int maximum); void add(XYDataItem item); void add(double x, double y); void add(double x, double y, boolean notify); void add(double x, Number y); void add(double x, Number y, boolean notify); void add(Number x, Number y); void add(Number x, Number y, boolean notify); void add(XYDataItem item, boolean notify); void delete(int start, int end); XYDataItem remove(int index); XYDataItem remove(Number x); void clear(); XYDataItem getDataItem(int index); Number getX(int index); Number getY(int index); void updateByIndex(int index, Number y); void update(Number x, Number y); XYDataItem addOrUpdate(double x, double y); XYDataItem addOrUpdate(Number x, Number y); XYDataItem addOrUpdate(XYDataItem item); int indexOf(Number x); double[][] toArray(); @Override Object clone(); XYSeries createCopy(int start, int end); @Override boolean equals(Object obj); @Override int hashCode(); }
XYSeries extends Series implements Cloneable, Serializable { public double[][] toArray() { int itemCount = getItemCount(); double[][] result = new double[2][itemCount]; for (int i = 0; i < itemCount; i++) { result[0][i] = this.getX(i).doubleValue(); Number y = getY(i); if (y != null) { result[1][i] = y.doubleValue(); } else { result[1][i] = Double.NaN; } } return result; } XYSeries(Comparable key);  XYSeries(Comparable key, boolean autoSort);  XYSeries(Comparable key, boolean autoSort,
            boolean allowDuplicateXValues); double getMinX(); double getMaxX(); double getMinY(); double getMaxY(); boolean getAutoSort(); boolean getAllowDuplicateXValues(); @Override int getItemCount(); List<XYDataItem> getItems(); int getMaximumItemCount(); void setMaximumItemCount(int maximum); void add(XYDataItem item); void add(double x, double y); void add(double x, double y, boolean notify); void add(double x, Number y); void add(double x, Number y, boolean notify); void add(Number x, Number y); void add(Number x, Number y, boolean notify); void add(XYDataItem item, boolean notify); void delete(int start, int end); XYDataItem remove(int index); XYDataItem remove(Number x); void clear(); XYDataItem getDataItem(int index); Number getX(int index); Number getY(int index); void updateByIndex(int index, Number y); void update(Number x, Number y); XYDataItem addOrUpdate(double x, double y); XYDataItem addOrUpdate(Number x, Number y); XYDataItem addOrUpdate(XYDataItem item); int indexOf(Number x); double[][] toArray(); @Override Object clone(); XYSeries createCopy(int start, int end); @Override boolean equals(Object obj); @Override int hashCode();  }