Example usage for org.jfree.data.time.ohlc OHLCSeries clone

List of usage examples for org.jfree.data.time.ohlc OHLCSeries clone

Introduction

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

Prototype

@Override
public Object clone() throws CloneNotSupportedException 

Source Link

Document

Returns a clone of the series.

Usage

From source file:org.jfree.data.time.ohlc.OHLCSeriesTest.java

/**
 * Confirm that cloning works.//from   w ww  . ja va  2  s.  c  o m
 */
@Test
public void testCloning() throws CloneNotSupportedException {
    OHLCSeries s1 = new OHLCSeries("s1");
    s1.add(new Year(2006), 2.0, 4.0, 1.0, 3.0);
    OHLCSeries s2 = (OHLCSeries) s1.clone();
    assertTrue(s1 != s2);
    assertTrue(s1.getClass() == s2.getClass());
    assertTrue(s1.equals(s2));
}