Example usage for org.jfree.data.xy XYCoordinate hashCode

List of usage examples for org.jfree.data.xy XYCoordinate hashCode

Introduction

In this page you can find the example usage for org.jfree.data.xy XYCoordinate hashCode.

Prototype

@Override
public int hashCode() 

Source Link

Document

Returns a hash code for this instance.

Usage

From source file:org.jfree.data.xy.XYCoordinateTest.java

/**
 * Two objects that are equal are required to return the same hashCode.
 *///from  w w  w  .j av  a2  s .  c om
@Test
public void testHashcode() {
    XYCoordinate v1 = new XYCoordinate(1.0, 2.0);
    XYCoordinate v2 = new XYCoordinate(1.0, 2.0);
    assertTrue(v1.equals(v2));
    int h1 = v1.hashCode();
    int h2 = v2.hashCode();
    assertEquals(h1, h2);
}