Example usage for org.jfree.data.category SlidingCategoryDataset getClass

List of usage examples for org.jfree.data.category SlidingCategoryDataset getClass

Introduction

In this page you can find the example usage for org.jfree.data.category SlidingCategoryDataset 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.category.SlidingCategoryDatasetTest.java

/**
 * Confirm that cloning works./*from w w w .j av  a2  s.  c  o m*/
 */
@Test
public void testCloning() throws CloneNotSupportedException {
    DefaultCategoryDataset u1 = new DefaultCategoryDataset();
    u1.addValue(1.0, "R1", "C1");
    u1.addValue(2.0, "R1", "C2");
    SlidingCategoryDataset d1 = new SlidingCategoryDataset(u1, 0, 5);
    SlidingCategoryDataset d2;
    d2 = (SlidingCategoryDataset) d1.clone();
    assertTrue(d1 != d2);
    assertTrue(d1.getClass() == d2.getClass());
    assertTrue(d1.equals(d2));

    // basic check for independence
    u1.addValue(3.0, "R1", "C3");
    assertFalse(d1.equals(d2));
    DefaultCategoryDataset u2 = (DefaultCategoryDataset) d2.getUnderlyingDataset();
    u2.addValue(3.0, "R1", "C3");
    assertTrue(d1.equals(d2));
}