本文主要是介绍2018.4.28,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
2018.4.28
for (ArrayList<Row> rows : joinedTable) {Row tmpLeftRow = rows.get(0);Row tmpRightRow = rows.get(1);boolean valid = false; // 这一行是否满足where条件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);}
}
这篇关于2018.4.28的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!