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

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

Introduction

In this page you can find the example usage for org.jfree.data.xy MatrixSeriesCollection 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.MatrixSeriesCollectionTest.java

/**
 * Confirm that cloning works.//  w ww . j ava 2 s.  c o  m
 */
@Test
public void testCloning() throws CloneNotSupportedException {
    MatrixSeries s1 = new MatrixSeries("Series", 2, 3);
    s1.update(0, 0, 1.1);
    MatrixSeriesCollection c1 = new MatrixSeriesCollection();
    c1.addSeries(s1);
    MatrixSeriesCollection c2 = (MatrixSeriesCollection) c1.clone();

    assertTrue(c1 != c2);
    assertTrue(c1.getClass() == c2.getClass());
    assertTrue(c1.equals(c2));

    // check independence
    s1.setDescription("XYZ");
    assertFalse(c1.equals(c2));
}

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

/**
 * Confirm that cloning works.//from www  . ja  v  a  2  s  .  com
 */
public void testCloning() {
    MatrixSeries s1 = new MatrixSeries("Series", 2, 3);
    s1.update(0, 0, 1.1);
    MatrixSeriesCollection c1 = new MatrixSeriesCollection();
    c1.addSeries(s1);
    MatrixSeriesCollection c2 = null;
    try {
        c2 = (MatrixSeriesCollection) c1.clone();
    } catch (CloneNotSupportedException e) {
        e.printStackTrace();
    }
    assertTrue(c1 != c2);
    assertTrue(c1.getClass() == c2.getClass());
    assertTrue(c1.equals(c2));

    // check independence
    s1.setDescription("XYZ");
    assertFalse(c1.equals(c2));
}