@Test public void testEquals() { DefaultXYDataset d1 = new DefaultXYDataset(); DefaultXYDataset d2 = new DefaultXYDataset(); assertEquals(d1, d2); assertEquals(d2, d1); double[] x1 = new double[] {1.0, 2.0, 3.0}; double[] y1 = new double[] {4.0, 5.0, 6.0}; double[][] data1 = new double[][] {x1, y1}; double[] x2 = new double[] {1.0, 2.0, 3.0}; double[] y2 = new double[] {4.0, 5.0, 6.0}; double[][] data2 = new double[][] {x2, y2}; d1.addSeries("S1", data1); assertFalse(d1.equals(d2)); d2.addSeries("S1", data2); assertEquals(d1, d2); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof DefaultXYDataset)) { return false; } DefaultXYDataset that = (DefaultXYDataset) obj; if (!this.seriesKeys.equals(that.seriesKeys)) { return false; } for (int i = 0; i < this.seriesList.size(); i++) { double[][] d1 = this.seriesList.get(i); double[][] d2 = that.seriesList.get(i); double[] d1x = d1[0]; double[] d2x = d2[0]; if (!Arrays.equals(d1x, d2x)) { return false; } double[] d1y = d1[1]; double[] d2y = d2[1]; if (!Arrays.equals(d1y, d2y)) { return false; } } return true; }
DefaultXYDataset extends AbstractXYDataset implements XYDataset, PublicCloneable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof DefaultXYDataset)) { return false; } DefaultXYDataset that = (DefaultXYDataset) obj; if (!this.seriesKeys.equals(that.seriesKeys)) { return false; } for (int i = 0; i < this.seriesList.size(); i++) { double[][] d1 = this.seriesList.get(i); double[][] d2 = that.seriesList.get(i); double[] d1x = d1[0]; double[] d2x = d2[0]; if (!Arrays.equals(d1x, d2x)) { return false; } double[] d1y = d1[1]; double[] d2y = d2[1]; if (!Arrays.equals(d1y, d2y)) { return false; } } return true; } }
DefaultXYDataset extends AbstractXYDataset implements XYDataset, PublicCloneable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof DefaultXYDataset)) { return false; } DefaultXYDataset that = (DefaultXYDataset) obj; if (!this.seriesKeys.equals(that.seriesKeys)) { return false; } for (int i = 0; i < this.seriesList.size(); i++) { double[][] d1 = this.seriesList.get(i); double[][] d2 = that.seriesList.get(i); double[] d1x = d1[0]; double[] d2x = d2[0]; if (!Arrays.equals(d1x, d2x)) { return false; } double[] d1y = d1[1]; double[] d2y = d2[1]; if (!Arrays.equals(d1y, d2y)) { return false; } } return true; } DefaultXYDataset(); }
DefaultXYDataset extends AbstractXYDataset implements XYDataset, PublicCloneable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof DefaultXYDataset)) { return false; } DefaultXYDataset that = (DefaultXYDataset) obj; if (!this.seriesKeys.equals(that.seriesKeys)) { return false; } for (int i = 0; i < this.seriesList.size(); i++) { double[][] d1 = this.seriesList.get(i); double[][] d2 = that.seriesList.get(i); double[] d1x = d1[0]; double[] d2x = d2[0]; if (!Arrays.equals(d1x, d2x)) { return false; } double[] d1y = d1[1]; double[] d2y = d2[1]; if (!Arrays.equals(d1y, d2y)) { return false; } } return true; } DefaultXYDataset(); @Override int getSeriesCount(); @Override Comparable getSeriesKey(int series); @Override int indexOf(Comparable seriesKey); @Override DomainOrder getDomainOrder(); @Override int getItemCount(int series); @Override double getXValue(int series, int item); @Override Number getX(int series, int item); @Override double getYValue(int series, int item); @Override Number getY(int series, int item); void addSeries(Comparable seriesKey, double[][] data); void removeSeries(Comparable seriesKey); @Override boolean equals(Object obj); @Override int hashCode(); @Override Object clone(); }
DefaultXYDataset extends AbstractXYDataset implements XYDataset, PublicCloneable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof DefaultXYDataset)) { return false; } DefaultXYDataset that = (DefaultXYDataset) obj; if (!this.seriesKeys.equals(that.seriesKeys)) { return false; } for (int i = 0; i < this.seriesList.size(); i++) { double[][] d1 = this.seriesList.get(i); double[][] d2 = that.seriesList.get(i); double[] d1x = d1[0]; double[] d2x = d2[0]; if (!Arrays.equals(d1x, d2x)) { return false; } double[] d1y = d1[1]; double[] d2y = d2[1]; if (!Arrays.equals(d1y, d2y)) { return false; } } return true; } DefaultXYDataset(); @Override int getSeriesCount(); @Override Comparable getSeriesKey(int series); @Override int indexOf(Comparable seriesKey); @Override DomainOrder getDomainOrder(); @Override int getItemCount(int series); @Override double getXValue(int series, int item); @Override Number getX(int series, int item); @Override double getYValue(int series, int item); @Override Number getY(int series, int item); void addSeries(Comparable seriesKey, double[][] data); void removeSeries(Comparable seriesKey); @Override boolean equals(Object obj); @Override int hashCode(); @Override Object clone();  }