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

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

Introduction

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

Prototype

@Override
public int hashCode() 

Source Link

Document

Returns a hash code.

Usage

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

/**
 * Two objects that are equal are required to return the same hashCode.
 *//*  ww w. j  ava2 s .  c om*/
@Test
public void testHashcode() {
    OHLCItem i1 = new OHLCItem(new Year(2009), 2.0, 4.0, 1.0, 3.0);
    OHLCItem i2 = new OHLCItem(new Year(2009), 2.0, 4.0, 1.0, 3.0);
    assertTrue(i1.equals(i2));
    int h1 = i1.hashCode();
    int h2 = i2.hashCode();
    assertEquals(h1, h2);
}