Example usage for org.jfree.data.xy DefaultOHLCDataset getClass

List of usage examples for org.jfree.data.xy DefaultOHLCDataset getClass

Introduction

In this page you can find the example usage for org.jfree.data.xy DefaultOHLCDataset getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:org.jfree.data.xy.DefaultOHLCDatasetTest.java

/**
 * Confirm that cloning works./*from ww w . j  a v  a 2  s.  co m*/
 */
@Test
public void testCloning2() throws CloneNotSupportedException {
    OHLCDataItem item1 = new OHLCDataItem(new Date(1L), 1.0, 2.0, 3.0, 4.0, 5.0);
    OHLCDataItem item2 = new OHLCDataItem(new Date(2L), 6.0, 7.0, 8.0, 9.0, 10.0);
    // create an array of items in reverse order
    OHLCDataItem[] items = new OHLCDataItem[] { item2, item1 };
    DefaultOHLCDataset d1 = new DefaultOHLCDataset("Series 1", items);
    DefaultOHLCDataset d2 = (DefaultOHLCDataset) d1.clone();
    assertTrue(d1 != d2);
    assertTrue(d1.getClass() == d2.getClass());
    assertTrue(d1.equals(d2));

    d1.sortDataByDate();
    assertFalse(d1.equals(d2));
}

From source file:org.jfree.data.xy.DefaultOHLCDatasetTest.java

/**
 * Confirm that cloning works.//from   w ww .  jav a 2  s . c  o m
 */
@Test
public void testCloning() throws CloneNotSupportedException {
    DefaultOHLCDataset d1 = new DefaultOHLCDataset("Series 1", new OHLCDataItem[0]);
    DefaultOHLCDataset d2 = (DefaultOHLCDataset) d1.clone();
    assertTrue(d1 != d2);
    assertTrue(d1.getClass() == d2.getClass());
    assertTrue(d1.equals(d2));
}

From source file:org.jfree.data.xy.junit.DefaultOHLCDatasetTest.java

/**
 * Confirm that cloning works./*from www. j ava2s.  c o m*/
 */
public void testCloning2() {
    OHLCDataItem item1 = new OHLCDataItem(new Date(1L), 1.0, 2.0, 3.0, 4.0, 5.0);
    OHLCDataItem item2 = new OHLCDataItem(new Date(2L), 6.0, 7.0, 8.0, 9.0, 10.0);
    // create an array of items in reverse order
    OHLCDataItem[] items = new OHLCDataItem[] { item2, item1 };
    DefaultOHLCDataset d1 = new DefaultOHLCDataset("Series 1", items);
    DefaultOHLCDataset d2 = null;
    try {
        d2 = (DefaultOHLCDataset) d1.clone();
    } catch (CloneNotSupportedException e) {
        e.printStackTrace();
    }
    assertTrue(d1 != d2);
    assertTrue(d1.getClass() == d2.getClass());
    assertTrue(d1.equals(d2));

    d1.sortDataByDate();
    assertFalse(d1.equals(d2));
}

From source file:org.jfree.data.xy.junit.DefaultOHLCDatasetTest.java

/**
 * Confirm that cloning works.//from ww  w.  ja  v a2s .c  o  m
 */
public void testCloning() {
    DefaultOHLCDataset d1 = new DefaultOHLCDataset("Series 1", new OHLCDataItem[0]);
    DefaultOHLCDataset d2 = null;
    try {
        d2 = (DefaultOHLCDataset) d1.clone();
    } catch (CloneNotSupportedException e) {
        e.printStackTrace();
    }
    assertTrue(d1 != d2);
    assertTrue(d1.getClass() == d2.getClass());
    assertTrue(d1.equals(d2));
}