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

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

Introduction

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

Prototype

@Override
public int hashCode() 

Source Link

Document

Returns a hash code value for the object.

Usage

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

/**
 * Some simple checks for the hashCode() method.
 *///  ww  w.  j a v a  2  s  . c  o m
public void testHashCode() {
    TimeSeries s1 = new TimeSeries("Test");
    TimeSeries s2 = new TimeSeries("Test");
    assertEquals(s1, s2);
    assertEquals(s1.hashCode(), s2.hashCode());

    s1.add(new Day(1, 1, 2007), 500.0);
    s2.add(new Day(1, 1, 2007), 500.0);
    assertEquals(s1, s2);
    assertEquals(s1.hashCode(), s2.hashCode());

    s1.add(new Day(2, 1, 2007), null);
    s2.add(new Day(2, 1, 2007), null);
    assertEquals(s1, s2);
    assertEquals(s1.hashCode(), s2.hashCode());

    s1.add(new Day(5, 1, 2007), 111.0);
    s2.add(new Day(5, 1, 2007), 111.0);
    assertEquals(s1, s2);
    assertEquals(s1.hashCode(), s2.hashCode());

    s1.add(new Day(9, 1, 2007), 1.0);
    s2.add(new Day(9, 1, 2007), 1.0);
    assertEquals(s1, s2);
    assertEquals(s1.hashCode(), s2.hashCode());
}

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

/**
 * Some simple checks for the hashCode() method.
 *///from  www  .  j a va2  s  .c o m
@Test
public void testHashCode() {
    TimeSeries s1 = new TimeSeries("Test");
    TimeSeries s2 = new TimeSeries("Test");
    assertEquals(s1, s2);
    assertEquals(s1.hashCode(), s2.hashCode());

    s1.add(new Day(1, 1, 2007), 500.0);
    s2.add(new Day(1, 1, 2007), 500.0);
    assertEquals(s1, s2);
    assertEquals(s1.hashCode(), s2.hashCode());

    s1.add(new Day(2, 1, 2007), null);
    s2.add(new Day(2, 1, 2007), null);
    assertEquals(s1, s2);
    assertEquals(s1.hashCode(), s2.hashCode());

    s1.add(new Day(5, 1, 2007), 111.0);
    s2.add(new Day(5, 1, 2007), 111.0);
    assertEquals(s1, s2);
    assertEquals(s1.hashCode(), s2.hashCode());

    s1.add(new Day(9, 1, 2007), 1.0);
    s2.add(new Day(9, 1, 2007), 1.0);
    assertEquals(s1, s2);
    assertEquals(s1.hashCode(), s2.hashCode());
}