2018.4.28
for (ArrayList<Row> rows : joinedTable) {
Row tmpLeftRow = rows.get(0);
Row tmpRightRow = rows.get(1);
boolean valid = false;
if (whereInLeft) {
if (tmpLeftRow.getEntries().get(whereAttrIndex).compareTo(whereAttrEntry) == 0) {
valid = true;
}
} else {
if (tmpRightRow.getEntries().get(whereAttrIndex).compareTo(whereAttrEntry) == 0) {
valid = true;
}
}
if (valid) {
StringBuilder currentRow = new StringBuilder();
for (int j = 0; j < leftAttrIndices.size() - 1; j++) {
currentRow
.append(tmpLeftRow.getEntries().get(leftAttrIndices.get(j)).toString())
.append(", ");
}
currentRow
.append(tmpLeftRow.getEntries()
.get(leftAttrIndices.get(leftAttrIndices.size() - 1)).toString());
if (!rightAttrIndices.isEmpty()) {
currentRow.append(", ");
}
for (int j = 0; j < rightAttrIndices.size() - 1; j++) {
currentRow
.append(tmpRightRow.getEntries().get(rightAttrIndices.get(j)).toString())
.append(", ");
}
currentRow
.append(tmpRightRow.getEntries()
.get(rightAttrIndices.get(rightAttrIndices.size() - 1)).toString());
ArrayList<String> tmpRow = new ArrayList<>();
tmpRow.add(currentRow.toString());
resp.rowList.add(tmpRow);
}
}