@Test public void testRemove() { DefaultStatisticalCategoryDataset data = new DefaultStatisticalCategoryDataset(); try { data.remove("R1", "R2"); fail("UnknownKeyException should have been thrown on the unknown key"); } catch (UnknownKeyException e) { assertEquals("Row key (R1) not recognised.", e.getMessage()); } data.add(1.0, 0.5, "R1", "C1"); assertEquals(new Range(1.0, 1.0), data.getRangeBounds(false)); assertEquals(new Range(0.5, 1.5), data.getRangeBounds(true)); data.add(1.4, 0.2, "R2", "C1"); assertEquals(1.0, data.getRangeLowerBound(false), EPSILON); assertEquals(1.4, data.getRangeUpperBound(false), EPSILON); assertEquals(0.5, data.getRangeLowerBound(true), EPSILON); assertEquals(1.6, data.getRangeUpperBound(true), EPSILON); data.remove("R1", "C1"); assertEquals(1.4, data.getRangeLowerBound(false), EPSILON); assertEquals(1.4, data.getRangeUpperBound(false), EPSILON); assertEquals(1.2, data.getRangeLowerBound(true), EPSILON); assertEquals(1.6, data.getRangeUpperBound(true), EPSILON); }
public void remove(Comparable rowKey, Comparable columnKey) { int r = getRowIndex(rowKey); int c = getColumnIndex(columnKey); this.data.removeObject(rowKey, columnKey); if ((r == this.maximumRangeValueRow && c == this.maximumRangeValueColumn) || (r == this.maximumRangeValueIncStdDevRow && c == this.maximumRangeValueIncStdDevColumn) || (r == this.minimumRangeValueRow && c == this.minimumRangeValueColumn) || (r == this.minimumRangeValueIncStdDevRow && c == this.minimumRangeValueIncStdDevColumn)) { updateBounds(); } fireDatasetChanged(); }
DefaultStatisticalCategoryDataset extends AbstractDataset implements StatisticalCategoryDataset, RangeInfo, PublicCloneable { public void remove(Comparable rowKey, Comparable columnKey) { int r = getRowIndex(rowKey); int c = getColumnIndex(columnKey); this.data.removeObject(rowKey, columnKey); if ((r == this.maximumRangeValueRow && c == this.maximumRangeValueColumn) || (r == this.maximumRangeValueIncStdDevRow && c == this.maximumRangeValueIncStdDevColumn) || (r == this.minimumRangeValueRow && c == this.minimumRangeValueColumn) || (r == this.minimumRangeValueIncStdDevRow && c == this.minimumRangeValueIncStdDevColumn)) { updateBounds(); } fireDatasetChanged(); } }
DefaultStatisticalCategoryDataset extends AbstractDataset implements StatisticalCategoryDataset, RangeInfo, PublicCloneable { public void remove(Comparable rowKey, Comparable columnKey) { int r = getRowIndex(rowKey); int c = getColumnIndex(columnKey); this.data.removeObject(rowKey, columnKey); if ((r == this.maximumRangeValueRow && c == this.maximumRangeValueColumn) || (r == this.maximumRangeValueIncStdDevRow && c == this.maximumRangeValueIncStdDevColumn) || (r == this.minimumRangeValueRow && c == this.minimumRangeValueColumn) || (r == this.minimumRangeValueIncStdDevRow && c == this.minimumRangeValueIncStdDevColumn)) { updateBounds(); } fireDatasetChanged(); } DefaultStatisticalCategoryDataset(); }
DefaultStatisticalCategoryDataset extends AbstractDataset implements StatisticalCategoryDataset, RangeInfo, PublicCloneable { public void remove(Comparable rowKey, Comparable columnKey) { int r = getRowIndex(rowKey); int c = getColumnIndex(columnKey); this.data.removeObject(rowKey, columnKey); if ((r == this.maximumRangeValueRow && c == this.maximumRangeValueColumn) || (r == this.maximumRangeValueIncStdDevRow && c == this.maximumRangeValueIncStdDevColumn) || (r == this.minimumRangeValueRow && c == this.minimumRangeValueColumn) || (r == this.minimumRangeValueIncStdDevRow && c == this.minimumRangeValueIncStdDevColumn)) { updateBounds(); } fireDatasetChanged(); } DefaultStatisticalCategoryDataset(); @Override Number getMeanValue(int row, int column); @Override Number getValue(int row, int column); @Override Number getValue(Comparable rowKey, Comparable columnKey); @Override Number getMeanValue(Comparable rowKey, Comparable columnKey); @Override Number getStdDevValue(int row, int column); @Override Number getStdDevValue(Comparable rowKey, Comparable columnKey); @Override int getColumnIndex(Comparable key); @Override Comparable getColumnKey(int column); @Override List<Comparable> getColumnKeys(); @Override int getRowIndex(Comparable key); @Override Comparable getRowKey(int row); @Override List<Comparable> getRowKeys(); @Override int getRowCount(); @Override int getColumnCount(); void add(double mean, double standardDeviation,
                    Comparable rowKey, Comparable columnKey); void add(Number mean, Number standardDeviation,
                    Comparable rowKey, Comparable columnKey); void remove(Comparable rowKey, Comparable columnKey); void removeRow(int rowIndex); void removeRow(Comparable rowKey); void removeColumn(int columnIndex); void removeColumn(Comparable columnKey); void clear(); @Override double getRangeLowerBound(boolean includeInterval); @Override double getRangeUpperBound(boolean includeInterval); @Override Range getRangeBounds(boolean includeInterval); @Override boolean equals(Object obj); @Override Object clone(); }
DefaultStatisticalCategoryDataset extends AbstractDataset implements StatisticalCategoryDataset, RangeInfo, PublicCloneable { public void remove(Comparable rowKey, Comparable columnKey) { int r = getRowIndex(rowKey); int c = getColumnIndex(columnKey); this.data.removeObject(rowKey, columnKey); if ((r == this.maximumRangeValueRow && c == this.maximumRangeValueColumn) || (r == this.maximumRangeValueIncStdDevRow && c == this.maximumRangeValueIncStdDevColumn) || (r == this.minimumRangeValueRow && c == this.minimumRangeValueColumn) || (r == this.minimumRangeValueIncStdDevRow && c == this.minimumRangeValueIncStdDevColumn)) { updateBounds(); } fireDatasetChanged(); } DefaultStatisticalCategoryDataset(); @Override Number getMeanValue(int row, int column); @Override Number getValue(int row, int column); @Override Number getValue(Comparable rowKey, Comparable columnKey); @Override Number getMeanValue(Comparable rowKey, Comparable columnKey); @Override Number getStdDevValue(int row, int column); @Override Number getStdDevValue(Comparable rowKey, Comparable columnKey); @Override int getColumnIndex(Comparable key); @Override Comparable getColumnKey(int column); @Override List<Comparable> getColumnKeys(); @Override int getRowIndex(Comparable key); @Override Comparable getRowKey(int row); @Override List<Comparable> getRowKeys(); @Override int getRowCount(); @Override int getColumnCount(); void add(double mean, double standardDeviation,
                    Comparable rowKey, Comparable columnKey); void add(Number mean, Number standardDeviation,
                    Comparable rowKey, Comparable columnKey); void remove(Comparable rowKey, Comparable columnKey); void removeRow(int rowIndex); void removeRow(Comparable rowKey); void removeColumn(int columnIndex); void removeColumn(Comparable columnKey); void clear(); @Override double getRangeLowerBound(boolean includeInterval); @Override double getRangeUpperBound(boolean includeInterval); @Override Range getRangeBounds(boolean includeInterval); @Override boolean equals(Object obj); @Override Object clone();  }