Example usage for org.jfree.data.time.ohlc OHLCSeries hashCode

List of usage examples for org.jfree.data.time.ohlc OHLCSeries hashCode

Introduction

In this page you can find the example usage for org.jfree.data.time.ohlc OHLCSeries hashCode.

Prototype

@Override
public int hashCode() 

Source Link

Document

Returns a hash code.

Usage

From source file:org.jfree.data.time.ohlc.OHLCSeriesTest.java

/**
 * Two objects that are equal are required to return the same hashCode.
 *///from w ww  .  ja  v  a 2  s . co  m
@Test
public void testHashcode() {
    OHLCSeries s1 = new OHLCSeries("Test");
    s1.add(new Year(2009), 1.0, 3.0, 2.0, 1.4);
    OHLCSeries s2 = new OHLCSeries("Test");
    s2.add(new Year(2009), 1.0, 3.0, 2.0, 1.4);
    assertTrue(s1.equals(s2));
    int h1 = s1.hashCode();
    int h2 = s2.hashCode();
    assertEquals(h1, h2);
}