@Test public void testGetValue2() { DefaultMultiValueCategoryDataset d = new DefaultMultiValueCategoryDataset(); try { d.getValue(0, 0); fail("IndexOutOfBoundsException should have been thrown on key out of range"); } catch (IndexOutOfBoundsException e) { assertEquals("Index: 0, Size: 0", e.getMessage()); } }
@Override public Number getValue(Comparable row, Comparable column) { List<Number> l = (List<Number>) this.data.getObject(row, column); double average = 0.0d; int count = 0; if (l != null && l.size() > 0) { for (Number n : l) { average += n.doubleValue(); count += 1; } if (count > 0) { average = average / count; } } if (count == 0) { return null; } return average; }
DefaultMultiValueCategoryDataset extends AbstractDataset implements MultiValueCategoryDataset, RangeInfo, PublicCloneable { @Override public Number getValue(Comparable row, Comparable column) { List<Number> l = (List<Number>) this.data.getObject(row, column); double average = 0.0d; int count = 0; if (l != null && l.size() > 0) { for (Number n : l) { average += n.doubleValue(); count += 1; } if (count > 0) { average = average / count; } } if (count == 0) { return null; } return average; } }
DefaultMultiValueCategoryDataset extends AbstractDataset implements MultiValueCategoryDataset, RangeInfo, PublicCloneable { @Override public Number getValue(Comparable row, Comparable column) { List<Number> l = (List<Number>) this.data.getObject(row, column); double average = 0.0d; int count = 0; if (l != null && l.size() > 0) { for (Number n : l) { average += n.doubleValue(); count += 1; } if (count > 0) { average = average / count; } } if (count == 0) { return null; } return average; } DefaultMultiValueCategoryDataset(); }
DefaultMultiValueCategoryDataset extends AbstractDataset implements MultiValueCategoryDataset, RangeInfo, PublicCloneable { @Override public Number getValue(Comparable row, Comparable column) { List<Number> l = (List<Number>) this.data.getObject(row, column); double average = 0.0d; int count = 0; if (l != null && l.size() > 0) { for (Number n : l) { average += n.doubleValue(); count += 1; } if (count > 0) { average = average / count; } } if (count == 0) { return null; } return average; } DefaultMultiValueCategoryDataset(); void add(List<Number> values, Comparable rowKey, Comparable columnKey); @Override List<Number> getValues(int row, int column); @Override List<Number> getValues(Comparable rowKey, Comparable columnKey); @Override Number getValue(Comparable row, Comparable column); @Override Number getValue(int row, int column); @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(); @Override double getRangeLowerBound(boolean includeInterval); @Override double getRangeUpperBound(boolean includeInterval); @Override Range getRangeBounds(boolean includeInterval); @Override boolean equals(Object obj); @Override Object clone(); }
DefaultMultiValueCategoryDataset extends AbstractDataset implements MultiValueCategoryDataset, RangeInfo, PublicCloneable { @Override public Number getValue(Comparable row, Comparable column) { List<Number> l = (List<Number>) this.data.getObject(row, column); double average = 0.0d; int count = 0; if (l != null && l.size() > 0) { for (Number n : l) { average += n.doubleValue(); count += 1; } if (count > 0) { average = average / count; } } if (count == 0) { return null; } return average; } DefaultMultiValueCategoryDataset(); void add(List<Number> values, Comparable rowKey, Comparable columnKey); @Override List<Number> getValues(int row, int column); @Override List<Number> getValues(Comparable rowKey, Comparable columnKey); @Override Number getValue(Comparable row, Comparable column); @Override Number getValue(int row, int column); @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(); @Override double getRangeLowerBound(boolean includeInterval); @Override double getRangeUpperBound(boolean includeInterval); @Override Range getRangeBounds(boolean includeInterval); @Override boolean equals(Object obj); @Override Object clone();  }