Example usage for org.jfree.data.time TimeSeries getClass

List of usage examples for org.jfree.data.time TimeSeries getClass

Introduction

In this page you can find the example usage for org.jfree.data.time TimeSeries 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.time.TimeSeriesTest.java

/**
 * A test for bug 1832432.//w w w .  j  a  va 2s .  c  om
 */
@Test
public void testBug1832432() throws CloneNotSupportedException {
    TimeSeries s1 = new TimeSeries("Series");
    TimeSeries s2 = (TimeSeries) s1.clone();
    assertTrue(s1 != s2);
    assertTrue(s1.getClass() == s2.getClass());
    assertTrue(s1.equals(s2));

    // test independence
    s1.add(new Day(1, 1, 2007), 100.0);
    assertFalse(s1.equals(s2));
}

From source file:org.jfree.data.time.junit.TimeSeriesTest.java

/**
 * A test for bug 1832432./*from  www  .j  a v  a  2 s  .c  om*/
 */
public void testBug1832432() {
    TimeSeries s1 = new TimeSeries("Series");
    TimeSeries s2 = null;
    try {
        s2 = (TimeSeries) s1.clone();
    } catch (CloneNotSupportedException e) {
        e.printStackTrace();
    }
    assertTrue(s1 != s2);
    assertTrue(s1.getClass() == s2.getClass());
    assertTrue(s1.equals(s2));

    // test independence
    s1.add(new Day(1, 1, 2007), 100.0);
    assertFalse(s1.equals(s2));
}