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

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

Introduction

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

/**
 * Two objects that are equal are required to return the same hashCode.
 *///from   w  w  w  . j  a va 2 s  .c o m
@Test
public void testHashcode() {
    Month m1 = new Month(2, 2003);
    Month m2 = new Month(2, 2003);
    assertTrue(m1.equals(m2));
    int h1 = m1.hashCode();
    int h2 = m2.hashCode();
    assertEquals(h1, h2);
}

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

/**
 * Two objects that are equal are required to return the same hashCode.
 *//*from  w  w w .j  ava2 s.  c o m*/
public void testHashcode() {
    Month m1 = new Month(2, 2003);
    Month m2 = new Month(2, 2003);
    assertTrue(m1.equals(m2));
    int h1 = m1.hashCode();
    int h2 = m2.hashCode();
    assertEquals(h1, h2);
}