@Test(dataProvider="identifiersTests") public void testGetRowIdentifiers(String[][] cellIdentifiers, int row, String[] expected) { LabeledTableModel model = new MockTableModel(cellIdentifiers, algorithm); List<String> rowIdentifiers = algorithm.getRowIdentifiers(row, model); assertEquals(rowIdentifiers, Arrays.asList(expected)); }
List<String> getRowIdentifiers(int row, LabeledTableModel model) { List<String> identifiers = new ArrayList<String>(); for (int col=0; col < model.getColumnCount(); ++col) { String identifier = model.getIdentifierAt(row, col); if (identifier!=null && !identifier.isEmpty()) { identifiers.add(identifier); } } return identifiers; }
AbbreviatingTableLabelingAlgorithm extends TableLabelingAlgorithm { List<String> getRowIdentifiers(int row, LabeledTableModel model) { List<String> identifiers = new ArrayList<String>(); for (int col=0; col < model.getColumnCount(); ++col) { String identifier = model.getIdentifierAt(row, col); if (identifier!=null && !identifier.isEmpty()) { identifiers.add(identifier); } } return identifiers; } }
AbbreviatingTableLabelingAlgorithm extends TableLabelingAlgorithm { List<String> getRowIdentifiers(int row, LabeledTableModel model) { List<String> identifiers = new ArrayList<String>(); for (int col=0; col < model.getColumnCount(); ++col) { String identifier = model.getIdentifierAt(row, col); if (identifier!=null && !identifier.isEmpty()) { identifiers.add(identifier); } } return identifiers; } AbbreviatingTableLabelingAlgorithm(); }
AbbreviatingTableLabelingAlgorithm extends TableLabelingAlgorithm { List<String> getRowIdentifiers(int row, LabeledTableModel model) { List<String> identifiers = new ArrayList<String>(); for (int col=0; col < model.getColumnCount(); ++col) { String identifier = model.getIdentifierAt(row, col); if (identifier!=null && !identifier.isEmpty()) { identifiers.add(identifier); } } return identifiers; } AbbreviatingTableLabelingAlgorithm(); @Override void computeLabels(LabeledTableModel model); String[] getContextLabels(); void setContextLabels(String... labels); }
AbbreviatingTableLabelingAlgorithm extends TableLabelingAlgorithm { List<String> getRowIdentifiers(int row, LabeledTableModel model) { List<String> identifiers = new ArrayList<String>(); for (int col=0; col < model.getColumnCount(); ++col) { String identifier = model.getIdentifierAt(row, col); if (identifier!=null && !identifier.isEmpty()) { identifiers.add(identifier); } } return identifiers; } AbbreviatingTableLabelingAlgorithm(); @Override void computeLabels(LabeledTableModel model); String[] getContextLabels(); void setContextLabels(String... labels);  }