Example usage for org.jfree.data.time TimeTableXYDataset clone

List of usage examples for org.jfree.data.time TimeTableXYDataset clone

Introduction

In this page you can find the example usage for org.jfree.data.time TimeTableXYDataset clone.

Prototype

@Override
public Object clone() throws CloneNotSupportedException 

Source Link

Document

Returns a clone of this dataset.

Usage

From source file:org.jfree.data.time.TimeTableXYDatasetTest.java

/**
 * Some checks for cloning.//from  w w  w  . j a v a2  s.  co  m
 */
@Test
public void testClone() {

    TimeTableXYDataset d = new TimeTableXYDataset();
    d.add(new Year(1999), 25.0, "Series");

    TimeTableXYDataset clone = null;
    try {
        clone = (TimeTableXYDataset) d.clone();
    } catch (CloneNotSupportedException e) {
        assertTrue(false);
    }
    assertTrue(clone.equals(d));

    // now test that the clone is independent of the original
    clone.add(new Year(2004), 1.2, "SS");
    assertFalse(clone.equals(d));
}