Example usage for org.jfree.data.time Year equals

List of usage examples for org.jfree.data.time Year equals

Introduction

In this page you can find the example usage for org.jfree.data.time Year equals.

Prototype

@Override
public boolean equals(Object obj) 

Source Link

Document

Tests the equality of this Year object to an arbitrary object.

Usage

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

/**
 * Check that a Year instance is equal to itself.
 *
 * SourceForge Bug ID: 558850./* w  w  w  .  j  ava  2 s.c  o  m*/
 */
@Test
public void testEqualsSelf() {
    Year year = new Year();
    assertTrue(year.equals(year));
}

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

/**
 * Two objects that are equal are required to return the same hashCode.
 *///from w  w  w  .  j ava2 s.c o  m
@Test
public void testHashcode() {
    Year y1 = new Year(1988);
    Year y2 = new Year(1988);
    assertTrue(y1.equals(y2));
    int h1 = y1.hashCode();
    int h2 = y2.hashCode();
    assertEquals(h1, h2);
}

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

/**
 * Tests the equals method.//w w  w . j a v  a 2s . c  o  m
 */
@Test
public void testEquals() {
    Year year1 = new Year(2002);
    Year year2 = new Year(2002);
    assertTrue(year1.equals(year2));

    year1 = new Year(1999);
    assertFalse(year1.equals(year2));
    year2 = new Year(1999);
    assertTrue(year1.equals(year2));
}