@Test public void testGetValue() { DefaultKeyedValues2D d = new DefaultKeyedValues2D(); d.addValue(1.0, "R1", "C1"); assertEquals(1.0, d.getValue("R1", "C1")); try { d.getValue("XX", "C1"); fail("UnknownKeyException should have been thrown on unknown key"); } catch (UnknownKeyException e) { assertEquals("Unrecognised rowKey: XX", e.getMessage()); } try { d.getValue("R1", "XX"); fail("UnknownKeyException should have been thrown on unknown key"); } catch (UnknownKeyException e) { assertEquals("Unrecognised columnKey: XX", e.getMessage()); } }
@Override public Number getValue(int row, int column) { Number result = null; DefaultKeyedValues rowData = this.rows.get(row); if (rowData != null) { Comparable columnKey = this.columnKeys.get(column); int index = rowData.getIndex(columnKey); if (index >= 0) { result = rowData.getValue(index); } } return result; }
DefaultKeyedValues2D implements KeyedValues2D, PublicCloneable,
        Cloneable, Serializable { @Override public Number getValue(int row, int column) { Number result = null; DefaultKeyedValues rowData = this.rows.get(row); if (rowData != null) { Comparable columnKey = this.columnKeys.get(column); int index = rowData.getIndex(columnKey); if (index >= 0) { result = rowData.getValue(index); } } return result; } }
DefaultKeyedValues2D implements KeyedValues2D, PublicCloneable,
        Cloneable, Serializable { @Override public Number getValue(int row, int column) { Number result = null; DefaultKeyedValues rowData = this.rows.get(row); if (rowData != null) { Comparable columnKey = this.columnKeys.get(column); int index = rowData.getIndex(columnKey); if (index >= 0) { result = rowData.getValue(index); } } return result; } DefaultKeyedValues2D();  DefaultKeyedValues2D(boolean sortRowKeys); }
DefaultKeyedValues2D implements KeyedValues2D, PublicCloneable,
        Cloneable, Serializable { @Override public Number getValue(int row, int column) { Number result = null; DefaultKeyedValues rowData = this.rows.get(row); if (rowData != null) { Comparable columnKey = this.columnKeys.get(column); int index = rowData.getIndex(columnKey); if (index >= 0) { result = rowData.getValue(index); } } return result; } DefaultKeyedValues2D();  DefaultKeyedValues2D(boolean sortRowKeys); @Override int getRowCount(); @Override int getColumnCount(); @Override Number getValue(int row, int column); @Override Comparable getRowKey(int row); @Override int getRowIndex(Comparable key); @Override List<Comparable> getRowKeys(); @Override Comparable getColumnKey(int column); @Override int getColumnIndex(Comparable key); @Override List<Comparable> getColumnKeys(); @Override Number getValue(Comparable rowKey, Comparable columnKey); void addValue(Number value, Comparable rowKey,
                         Comparable columnKey); void setValue(Number value, Comparable rowKey,
                         Comparable columnKey); void removeValue(Comparable rowKey, Comparable columnKey); void removeRow(int rowIndex); void removeRow(Comparable rowKey); void removeColumn(int columnIndex); void removeColumn(Comparable columnKey); void clear(); @Override boolean equals(Object o); @Override int hashCode(); @Override Object clone(); }
DefaultKeyedValues2D implements KeyedValues2D, PublicCloneable,
        Cloneable, Serializable { @Override public Number getValue(int row, int column) { Number result = null; DefaultKeyedValues rowData = this.rows.get(row); if (rowData != null) { Comparable columnKey = this.columnKeys.get(column); int index = rowData.getIndex(columnKey); if (index >= 0) { result = rowData.getValue(index); } } return result; } DefaultKeyedValues2D();  DefaultKeyedValues2D(boolean sortRowKeys); @Override int getRowCount(); @Override int getColumnCount(); @Override Number getValue(int row, int column); @Override Comparable getRowKey(int row); @Override int getRowIndex(Comparable key); @Override List<Comparable> getRowKeys(); @Override Comparable getColumnKey(int column); @Override int getColumnIndex(Comparable key); @Override List<Comparable> getColumnKeys(); @Override Number getValue(Comparable rowKey, Comparable columnKey); void addValue(Number value, Comparable rowKey,
                         Comparable columnKey); void setValue(Number value, Comparable rowKey,
                         Comparable columnKey); void removeValue(Comparable rowKey, Comparable columnKey); void removeRow(int rowIndex); void removeRow(Comparable rowKey); void removeColumn(int columnIndex); void removeColumn(Comparable columnKey); void clear(); @Override boolean equals(Object o); @Override int hashCode(); @Override Object clone();  }