Example usage for org.jfree.data.gantt SlidingGanttCategoryDataset getClass

List of usage examples for org.jfree.data.gantt SlidingGanttCategoryDataset getClass

Introduction

In this page you can find the example usage for org.jfree.data.gantt SlidingGanttCategoryDataset 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.gantt.SlidingGanttCategoryDatasetTest.java

/**
 * Confirm that cloning works./*from   w  ww  . j  av a  2 s . c  o  m*/
 */
@Test
public void testCloning() throws CloneNotSupportedException {
    TaskSeries s1 = new TaskSeries("Series");
    s1.add(new Task("Task 1", new Date(0L), new Date(1L)));
    TaskSeriesCollection u1 = new TaskSeriesCollection();
    u1.add(s1);
    SlidingGanttCategoryDataset d1 = new SlidingGanttCategoryDataset(u1, 0, 5);
    SlidingGanttCategoryDataset d2 = (SlidingGanttCategoryDataset) d1.clone();
    assertTrue(d1 != d2);
    assertTrue(d1.getClass() == d2.getClass());
    assertTrue(d1.equals(d2));

    // basic check for independence
    s1.add(new Task("Task 2", new Date(10L), new Date(11L)));
    assertFalse(d1.equals(d2));
    TaskSeriesCollection u2 = (TaskSeriesCollection) d2.getUnderlyingDataset();
    TaskSeries s2 = u2.getSeries("Series");
    s2.add(new Task("Task 2", new Date(10L), new Date(11L)));
    assertTrue(d1.equals(d2));
}