Example usage for org.jfree.data.xy XYSeries hashCode

List of usage examples for org.jfree.data.xy XYSeries hashCode

Introduction

In this page you can find the example usage for org.jfree.data.xy XYSeries hashCode.

Prototype

@Override
public int hashCode() 

Source Link

Document

Returns a hash code.

Usage

From source file:org.jfree.data.xy.XYSeriesTest.java

/**
 * Some simple checks for the hashCode() method.
 *//*from ww  w .  ja va 2 s. c  om*/
@Test
public void testHashCode() {
    XYSeries s1 = new XYSeries("Test");
    XYSeries s2 = new XYSeries("Test");
    assertEquals(s1, s2);
    assertEquals(s1.hashCode(), s2.hashCode());

    s1.add(1.0, 500.0);
    s2.add(1.0, 500.0);
    assertEquals(s1, s2);
    assertEquals(s1.hashCode(), s2.hashCode());

    s1.add(2.0, null);
    s2.add(2.0, null);
    assertEquals(s1, s2);
    assertEquals(s1.hashCode(), s2.hashCode());

    s1.add(5.0, 111.0);
    s2.add(5.0, 111.0);
    assertEquals(s1, s2);
    assertEquals(s1.hashCode(), s2.hashCode());

    s1.add(9.0, 1.0);
    s2.add(9.0, 1.0);
    assertEquals(s1, s2);
    assertEquals(s1.hashCode(), s2.hashCode());
}