public String getLabelResource() {
return "summary_report"; //$NON-NLS-1$
}
public void add(SampleResult res) {
Calculator row = null;
final String sampleLabel = res.getSampleLabel(useGroupName.isSelected());
synchronized (tableRows) {
row = (Calculator) tableRows.get(sampleLabel);
if (row == null) {
row = new Calculator(sampleLabel);
tableRows.put(row.getLabel(), row);
model.insertRow(row, model.getRowCount() - 1);
}
}
/*
* Synch is needed because multiple threads can update the counts.
*/
synchronized(row) {
row.addSample(res);
}
Calculator tot = ((Calculator) tableRows.get(TOTAL_ROW_LABEL));
synchronized(tot) {
tot.addSample(res);
}
model.fireTableDataChanged();
}