RankProbabilityTableModel extends AbstractTableModel { public Object getValueAt(int rowIndex, int columnIndex) { Treatment treatment = d_summary.getTreatments().get(rowIndex); if (columnIndex == 0) { return treatment.format(d_preferDescription); } else { return d_summary.getDefined() ? d_summary.getValue(treatment, columnIndex) : ""; } } RankProbabilityTableModel(RankProbabilitySummary summary, boolean preferDescription);  RankProbabilityTableModel(RankProbabilitySummary summary); int getColumnCount(); int getRowCount(); @Override String getColumnName(int column); @Override Class<?> getColumnClass(int column); Object getValueAt(int rowIndex, int columnIndex);  }
@Test public void testRowName() { assertEquals(d_ta.getId(), d_model.getValueAt(0, 0)); assertEquals(d_tb.getId(), d_model.getValueAt(1, 0)); assertEquals(d_tc.getId(), d_model.getValueAt(2, 0)); }
@Test public void testValueAt() { for (int t = 0; t < d_summary.getTreatments().size(); ++t) { for (int r = 1; r <= d_summary.getTreatments().size(); ++r) { assertEquals("", d_model.getValueAt(t, r)); } } d_results.makeSamplesAvailable(); for (int t = 0; t < d_summary.getTreatments().size(); ++t) { for (int r = 1; r <= d_summary.getTreatments().size(); ++r) { assertEquals(d_summary.getValue(d_summary.getTreatments().get(t), r), d_model.getValueAt(t, r)); } } }