private void updateBranchesOfABox(final AddBranchDependency branch, final ABox abox) { final List<Branch> branches = abox.getBranches(); // decrease branch id for each branch after the branch we're removing // also need to change the dependency set for each label for (int i = branch.getBranch().getBranchIndexInABox(); i < branches.size(); i++) { final Branch br = branches.get(i); // cast for ease DependencySet termDepends = br.getTermDepends(); // update the term depends in the branch if (termDepends.getBranch() > branch.getBranch().getBranchIndexInABox()) termDepends = termDepends.copy(termDepends.getBranch() - 1); for (int j = branch.getBranch().getBranchIndexInABox(); j < _kb.getABox().getBranches().size(); j++) if (termDepends.contains(j)) { termDepends.remove(j); termDepends.add(j - 1); break; } br.setTermDepends(termDepends); } branches.remove(branch.getBranch()); // remove the actual branch }
private void updateBranchesOfABox(final AddBranchDependency branch, final ABox abox) { final List<Branch> branches = abox.getBranches(); // decrease branch id for each branch after the branch we're removing // also need to change the dependency set for each label for (int i = branch.getBranch().getBranchIndexInABox(); i < branches.size(); i++) { final Branch br = branches.get(i); // cast for ease DependencySet termDepends = br.getTermDepends(); // update the term depends in the branch if (termDepends.getBranch() > branch.getBranch().getBranchIndexInABox()) termDepends = termDepends.copy(termDepends.getBranch() - 1); for (int j = branch.getBranch().getBranchIndexInABox(); j < _kb.getABox().getBranches().size(); j++) if (termDepends.contains(j)) { termDepends.remove(j); termDepends.add(j - 1); break; } br.setTermDepends(termDepends); } branches.remove(branch.getBranch()); // remove the actual branch }
ds.add(prevBranch.getBranchIndexInABox()); else break;
ds.add(prevBranch.getBranchIndexInABox()); else break;