List of usage examples for org.jfree.data.statistics SimpleHistogramBin equals
@Override public boolean equals(Object obj)
From source file:org.jfree.data.statistics.SimpleHistogramBinTest.java
/** * Ensure that the equals() method can distinguish all fields. */// w ww .j a va 2 s .co m @Test public void testEquals() { SimpleHistogramBin b1 = new SimpleHistogramBin(1.0, 2.0); SimpleHistogramBin b2 = new SimpleHistogramBin(1.0, 2.0); assertTrue(b1.equals(b2)); assertTrue(b2.equals(b1)); b1 = new SimpleHistogramBin(1.1, 2.0, true, true); assertFalse(b1.equals(b2)); b2 = new SimpleHistogramBin(1.1, 2.0, true, true); assertTrue(b1.equals(b2)); b1 = new SimpleHistogramBin(1.1, 2.2, true, true); assertFalse(b1.equals(b2)); b2 = new SimpleHistogramBin(1.1, 2.2, true, true); assertTrue(b1.equals(b2)); b1 = new SimpleHistogramBin(1.1, 2.2, false, true); assertFalse(b1.equals(b2)); b2 = new SimpleHistogramBin(1.1, 2.2, false, true); assertTrue(b1.equals(b2)); b1 = new SimpleHistogramBin(1.1, 2.2, false, false); assertFalse(b1.equals(b2)); b2 = new SimpleHistogramBin(1.1, 2.2, false, false); assertTrue(b1.equals(b2)); b1.setItemCount(99); assertFalse(b1.equals(b2)); b2.setItemCount(99); assertTrue(b1.equals(b2)); }
From source file:org.jfree.data.statistics.SimpleHistogramBinTest.java
/** * Some checks for the clone() method./*from ww w .jav a 2 s . co m*/ */ @Test public void testCloning() throws CloneNotSupportedException { SimpleHistogramBin b1 = new SimpleHistogramBin(1.1, 2.2, false, true); b1.setItemCount(99); SimpleHistogramBin b2 = (SimpleHistogramBin) b1.clone(); assertTrue(b1 != b2); assertTrue(b1.getClass() == b2.getClass()); assertTrue(b1.equals(b2)); // check that clone is independent of the original b2.setItemCount(111); assertFalse(b1.equals(b2)); }