Example usage for org.jfree.data.statistics DefaultBoxAndWhiskerXYDataset clone

List of usage examples for org.jfree.data.statistics DefaultBoxAndWhiskerXYDataset clone

Introduction

In this page you can find the example usage for org.jfree.data.statistics DefaultBoxAndWhiskerXYDataset clone.

Prototype

@Override
public Object clone() throws CloneNotSupportedException 

Source Link

Document

Returns a clone of the plot.

Usage

From source file:org.jfree.data.statistics.DefaultBoxAndWhiskerXYDatasetTest.java

/**
 * Confirm that cloning works.//w ww .j av  a 2s .com
 */
@Test
public void testCloning() throws CloneNotSupportedException {
    DefaultBoxAndWhiskerXYDataset d1 = new DefaultBoxAndWhiskerXYDataset("Series");
    d1.add(new Date(1L), new BoxAndWhiskerItem(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, new ArrayList()));
    DefaultBoxAndWhiskerXYDataset d2 = (DefaultBoxAndWhiskerXYDataset) d1.clone();
    assertTrue(d1 != d2);
    assertTrue(d1.getClass() == d2.getClass());
    assertTrue(d1.equals(d2));

    // test independence
    d1.add(new Date(2L), new BoxAndWhiskerItem(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, new ArrayList()));
    assertFalse(d1.equals(d2));
}