/** Some tests for the clear() method. */ public void testClear() { DefaultPieDataset d = new DefaultPieDataset(); d.addChangeListener(this); // no event is generated if the dataset is already empty d.clear(); assertNull(this.lastEvent); d.setValue("A", 1.0); assertEquals(1, d.getItemCount()); this.lastEvent = null; d.clear(); assertNotNull(this.lastEvent); assertEquals(0, d.getItemCount()); }
public boolean isPieDatasetEmpty() { final DefaultPieDataset cd = getPieDataset(); return ((cd == null) || (cd.getItemCount() == 0)); }