Example usage for org.jfree.data.time Hour hashCode

List of usage examples for org.jfree.data.time Hour hashCode

Introduction

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

Prototype

@Override
public int hashCode() 

Source Link

Document

Returns a hash code for this object instance.

Usage

From source file:org.jfree.data.time.HourTest.java

/**
 * Two objects that are equal are required to return the same hashCode.
 *//*from  w  w w .j  av a 2s . c  o  m*/
@Test
public void testHashcode() {
    Hour h1 = new Hour(7, 9, 10, 1999);
    Hour h2 = new Hour(7, 9, 10, 1999);
    assertTrue(h1.equals(h2));
    int hash1 = h1.hashCode();
    int hash2 = h2.hashCode();
    assertEquals(hash1, hash2);
}

From source file:org.jfree.data.time.junit.HourTest.java

/**
 * Two objects that are equal are required to return the same hashCode.
 *//*from  ww w.jav  a 2  s  .  co  m*/
public void testHashcode() {
    Hour h1 = new Hour(7, 9, 10, 1999);
    Hour h2 = new Hour(7, 9, 10, 1999);
    assertTrue(h1.equals(h2));
    int hash1 = h1.hashCode();
    int hash2 = h2.hashCode();
    assertEquals(hash1, hash2);
}