List of usage examples for org.jfree.data.statistics DefaultBoxAndWhiskerXYDataset equals
@Override public boolean equals(Object obj)
From source file:org.jfree.data.statistics.DefaultBoxAndWhiskerXYDatasetTest.java
/** * Confirm that the equals method can distinguish all the required fields. */// www .j ava 2 s . c o m @Test public void testEquals() { DefaultBoxAndWhiskerXYDataset d1 = new DefaultBoxAndWhiskerXYDataset("Series"); DefaultBoxAndWhiskerXYDataset d2 = new DefaultBoxAndWhiskerXYDataset("Series"); assertTrue(d1.equals(d2)); d1.add(new Date(1L), new BoxAndWhiskerItem(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, new ArrayList())); assertFalse(d1.equals(d2)); d2.add(new Date(1L), new BoxAndWhiskerItem(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, new ArrayList())); assertTrue(d1.equals(d2)); }
From source file:org.jfree.data.statistics.DefaultBoxAndWhiskerXYDatasetTest.java
/** * Confirm that cloning works.//from w ww . j a va2 s .c o m */ @Test public void testCloning() throws CloneNotSupportedException { DefaultBoxAndWhiskerXYDataset d1 = new DefaultBoxAndWhiskerXYDataset("Series"); d1.add(new Date(1L), new BoxAndWhiskerItem(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, new ArrayList())); DefaultBoxAndWhiskerXYDataset d2 = (DefaultBoxAndWhiskerXYDataset) d1.clone(); assertTrue(d1 != d2); assertTrue(d1.getClass() == d2.getClass()); assertTrue(d1.equals(d2)); // test independence d1.add(new Date(2L), new BoxAndWhiskerItem(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, new ArrayList())); assertFalse(d1.equals(d2)); }
From source file:org.jfree.data.statistics.DefaultBoxAndWhiskerXYDatasetTest.java
/** * Serialize an instance, restore it, and check for equality. *//*from ww w .j av a 2 s.c om*/ @Test public void testSerialization() { DefaultBoxAndWhiskerXYDataset d1 = new DefaultBoxAndWhiskerXYDataset("Series"); d1.add(new Date(1L), new BoxAndWhiskerItem(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, new ArrayList())); DefaultBoxAndWhiskerXYDataset d2 = (DefaultBoxAndWhiskerXYDataset) TestUtilities.serialised(d1); assertEquals(d1, d2); // test independence d1.add(new Date(2L), new BoxAndWhiskerItem(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, new ArrayList())); assertFalse(d1.equals(d2)); }