コード例 #1
0
  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;
  }
コード例 #2
0
  private int setPriority(OutPutScreen outPutScreen) {
    if (outPutScreen.isNoRenforcement()
        && !outPutScreen.isJtrForSideOne()
        && !outPutScreen.isJtrForSideTwo()) {
      return 0;
    } else {

      if (outPutScreen.isInternalBothSide()) {
        return 3;
      }
      if (outPutScreen.isJtrForSideOne()) {
        return 2;
      }
      if (outPutScreen.isJtrForSideTwo()) {
        return 2;
      }
      if (outPutScreen.isInternalReinforcement()) {
        return 1;
      }
      if (outPutScreen.isIntAndExtEachSide()) {
        return 5;
      }
      if (outPutScreen.isExtAndInternalEachSide()) {
        return 6;
      }

      if (outPutScreen.isExternalBothSide()) {

        return 4;
      }
      if (outPutScreen.isExternalReinforcement()) {
        return 2;
      }
      if (outPutScreen.isExtAndInternalEachSide()) {
        return 6;
      }
      if (outPutScreen.isIntAndExtEachSide()) {
        return 5;
      }
    }
    return 7;
  }
コード例 #3
0
  private int calculateExternalScore(OutPutScreen outPutScreen) {

    int externalScore = 0;
    if (outPutScreen.isNoRenforcement()) {
      return externalScore;
    } else {
      if (outPutScreen.isExternalBothSide()) {

        externalScore = externalScore + 2;
      }
      if (outPutScreen.isExternalReinforcement()) {
        externalScore = externalScore + 1;
      }
      if (outPutScreen.isExtAndInternalEachSide()) {
        externalScore = externalScore + 1;
      }
      if (outPutScreen.isIntAndExtEachSide()) {
        externalScore = externalScore + 1;
      }
    }
    return externalScore;
  }