private List<OutPutScreen> getFinalOutPutScreen(List<OutPutScreen> outPutScreens) { boolean isScoreZero = false; for (OutPutScreen outPutScreen : outPutScreens) { System.out.println("Score"); outPutScreen.setScore(outPutScreen.getInternalScore() + outPutScreen.getExternalScore()); if (outPutScreen.getScore() == 0) { isScoreZero = true; } } if (isScoreZero) { return outPutScreens.subList(0, outPutScreens.size() > 5 ? 5 : outPutScreens.size()); } else { List<OutPutScreen> list = new ArrayList<OutPutScreen>(); for (OutPutScreen outPutScreen : outPutScreens) { if (outPutScreen.getInternalScore() == 1 && outPutScreen.getScore() == 1) { list.add(outPutScreen); } if (outPutScreen.getExternalScore() == 1 && outPutScreen.getScore() == 1) { list.add(outPutScreen); } } return list; } }
private List<OutPutScreen> getScoringSystemForOutPutScreen(List<OutPutScreen> outPutScreens) { List<OutPutScreen> outPutScreenList = new ArrayList<OutPutScreen>(); for (OutPutScreen outPutScreen : outPutScreens) { outPutScreen.setInternalScore(calculateInternalScore(outPutScreen)); outPutScreen.setExternalScore(calculateExternalScore(outPutScreen)); outPutScreen.setScore(outPutScreen.getInternalScore() + outPutScreen.getExternalScore()); outPutScreen.setPriority(setPriority(outPutScreen)); outPutScreenList.add(outPutScreen); } return outPutScreenList; }
private List<OutPutScreen> getOnlyExternalReinforcementOptions(List<OutPutScreen> outPutScreens) { List<OutPutScreen> outPutScreenForExternalReinforcementOnly = new ArrayList<OutPutScreen>(); for (OutPutScreen outPutScreen : outPutScreens) { if (outPutScreen.isExternalReinforcement() || outPutScreen.isExternalBothSide()) { outPutScreen.setScore(outPutScreen.getExternalScore()); outPutScreenForExternalReinforcementOnly.add(outPutScreen); } } return outPutScreenForExternalReinforcementOnly; }