@Test public void testCloning() throws CloneNotSupportedException { DefaultOHLCDataset d1 = new DefaultOHLCDataset("Series 1", new OHLCDataItem[0]); DefaultOHLCDataset d2 = (DefaultOHLCDataset) d1.clone(); assertNotSame(d1, d2); assertSame(d1.getClass(), d2.getClass()); assertEquals(d1, d2); }
@Override public Object clone() throws CloneNotSupportedException { DefaultOHLCDataset clone = (DefaultOHLCDataset) super.clone(); clone.data = new OHLCDataItem[this.data.length]; System.arraycopy(this.data, 0, clone.data, 0, this.data.length); return clone; }
DefaultOHLCDataset extends AbstractXYDataset implements OHLCDataset, PublicCloneable { @Override public Object clone() throws CloneNotSupportedException { DefaultOHLCDataset clone = (DefaultOHLCDataset) super.clone(); clone.data = new OHLCDataItem[this.data.length]; System.arraycopy(this.data, 0, clone.data, 0, this.data.length); return clone; } }
DefaultOHLCDataset extends AbstractXYDataset implements OHLCDataset, PublicCloneable { @Override public Object clone() throws CloneNotSupportedException { DefaultOHLCDataset clone = (DefaultOHLCDataset) super.clone(); clone.data = new OHLCDataItem[this.data.length]; System.arraycopy(this.data, 0, clone.data, 0, this.data.length); return clone; } DefaultOHLCDataset(Comparable key, OHLCDataItem[] data); }
DefaultOHLCDataset extends AbstractXYDataset implements OHLCDataset, PublicCloneable { @Override public Object clone() throws CloneNotSupportedException { DefaultOHLCDataset clone = (DefaultOHLCDataset) super.clone(); clone.data = new OHLCDataItem[this.data.length]; System.arraycopy(this.data, 0, clone.data, 0, this.data.length); return clone; } DefaultOHLCDataset(Comparable key, OHLCDataItem[] data); @Override Comparable getSeriesKey(int series); @Override Number getX(int series, int item); Date getXDate(int series, int item); @Override Number getY(int series, int item); @Override Number getHigh(int series, int item); @Override double getHighValue(int series, int item); @Override Number getLow(int series, int item); @Override double getLowValue(int series, int item); @Override Number getOpen(int series, int item); @Override double getOpenValue(int series, int item); @Override Number getClose(int series, int item); @Override double getCloseValue(int series, int item); @Override Number getVolume(int series, int item); @Override double getVolumeValue(int series, int item); @Override int getSeriesCount(); @Override int getItemCount(int series); void sortDataByDate(); @Override boolean equals(Object obj); @Override Object clone(); }
DefaultOHLCDataset extends AbstractXYDataset implements OHLCDataset, PublicCloneable { @Override public Object clone() throws CloneNotSupportedException { DefaultOHLCDataset clone = (DefaultOHLCDataset) super.clone(); clone.data = new OHLCDataItem[this.data.length]; System.arraycopy(this.data, 0, clone.data, 0, this.data.length); return clone; } DefaultOHLCDataset(Comparable key, OHLCDataItem[] data); @Override Comparable getSeriesKey(int series); @Override Number getX(int series, int item); Date getXDate(int series, int item); @Override Number getY(int series, int item); @Override Number getHigh(int series, int item); @Override double getHighValue(int series, int item); @Override Number getLow(int series, int item); @Override double getLowValue(int series, int item); @Override Number getOpen(int series, int item); @Override double getOpenValue(int series, int item); @Override Number getClose(int series, int item); @Override double getCloseValue(int series, int item); @Override Number getVolume(int series, int item); @Override double getVolumeValue(int series, int item); @Override int getSeriesCount(); @Override int getItemCount(int series); void sortDataByDate(); @Override boolean equals(Object obj); @Override Object clone();  }