if (getComparisonValue(row1) < getComparisonValue(row2))
return -1;
if (getComparisonValue(row1) > getComparisonValue(row2))
return 1;
if (child != null) {
Table mainTable = row1.getOuterTable();
Table subTable = new Table(child, mainTable);
for (Row row : mainTable.getRows()) {
if (getComparisonValue(row1) == getComparisonValue(row))
subTable.addTeam(row.getTeam());
}
for (Match match : mainTable.getMatches()) {
if (subTable.getRow(match.getHomeTeam()) != null && subTable.getRow(match.getGuestTeam()) != null)
subTable.addMatch(match);
}
subTable.refresh();
if (mainTable.isShowSubTables()) {
ByteArrayOutputStream byteArrayStream = new ByteArrayOutputStream();
PrintStream printStream = new PrintStream(byteArrayStream);
subTable.print(printStream, true);
mainTable.addDumpedSubTable(byteArrayStream.toString());
}
int result = child.compare(subTable.getRow(row1.getTeam()), subTable.getRow(row2.getTeam()));
if (result != 0)
return result;
}
if (successor != null)
return successor.compare(row1, row2);