private void addActions(grdLimbWeightRow parentRow, StrengtheningProgramMovementCollection voMovementColl, boolean bAddValues, StrengtheningProgramVo voStrengtheningProgram) { if (parentRow == null || voMovementColl == null) return; for (int i = 0; i < voMovementColl.size(); i++) { grdLimbWeightRow childRow = parentRow.getRows().newRow(); childRow.setColLimbWeight(voMovementColl.get(i).toString()); childRow.setValue(voMovementColl.get(i)); if(bAddValues && voStrengtheningProgram!=null){ for (int k = 0; voStrengtheningProgram.getLimbWeightIsNotNull() && k < voStrengtheningProgram.getLimbWeight().size(); k++) { StrengtheningProgramLimbWeightVo voLimbWeightVo = voStrengtheningProgram.getLimbWeight().get(k); boolean sameType = childRow.getParentRow() != null && childRow.getParentRow().getValue() != null && childRow.getParentRow().getValue().equals(voLimbWeightVo.getLimbType()); boolean sameAction = childRow.getValue() != null && childRow.getValue().equals(voLimbWeightVo.getAction()); if (sameType && sameAction){ childRow.setColKgs(voLimbWeightVo.getKgs()); childRow.setColReps(voLimbWeightVo.getRepetitions()); } } } } }