Example usage for org.jfree.data KeyedObjects2D getClass

List of usage examples for org.jfree.data KeyedObjects2D getClass

Introduction

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

/**
 * Confirm that cloning works.//from  w ww  .  j  av a 2  s . c  om
 */
@Test
public void testCloning() throws CloneNotSupportedException {
    KeyedObjects2D o1 = new KeyedObjects2D();
    o1.setObject(new Integer(1), "V1", "C1");
    o1.setObject(null, "V2", "C1");
    o1.setObject(new Integer(3), "V3", "C2");
    KeyedObjects2D o2 = (KeyedObjects2D) o1.clone();
    assertTrue(o1 != o2);
    assertTrue(o1.getClass() == o2.getClass());
    assertTrue(o1.equals(o2));

    // check independence
    o1.addObject("XX", "R1", "C1");
    assertFalse(o1.equals(o2));
}