public void logicCaseCollect(String description) { if ((re.isIfCase(description) || re.isForCase(description)) && !re.isLogicBlock(description)) { logicTitle.put(String.valueOf(++logicIndex), description); int level = re.getLogicLevel(description); multiLogic.put(level + 1, logicIndex); logicFlag = true; } if ((!re.isIfCase(description) && !re.isForCase(description)) && re.isLogicBlock(description)) { int level = re.getLogicLevel(description); int index = multiLogic.get(level); if (logicBlock.containsKey(String.valueOf(index))) logicBlock.get(String.valueOf(index)).add(description); else { ArrayList<String> block = new ArrayList<String>(); block.add(description); logicBlock.put(String.valueOf(index), block); } } if ((re.isIfCase(description) || re.isForCase(description)) && re.isLogicBlock(description)) { logicTitle.put(String.valueOf(++logicIndex), description); int level = re.getLogicLevel(description); multiLogic.put(level + 1, logicIndex); int index = multiLogic.get(level); if (logicBlock.containsKey(String.valueOf(index))) logicBlock.get(String.valueOf(index)).add(String.valueOf(logicIndex)); else { ArrayList<String> block = new ArrayList<String>(); block.add(String.valueOf(logicIndex)); logicBlock.put(String.valueOf(index), block); } } }
private void executeLogicBlock(String index) throws DefinedException { ArrayList<String> blockList = logicBlock.get(String.valueOf(index)); for (int i = 0; i < blockList.size(); i++) { if (logicTitle.containsKey(blockList.get(i))) { if (re.isIfCase(logicTitle.get(blockList.get(i)))) this.executeIfBlock(blockList.get(i)); if (re.isForCase(logicTitle.get(blockList.get(i)))) this.executeForBlock(blockList.get(i)); } else { excute.setParam(param); excute.setDescription(blockList.get(i)); excute.setReplaceDesc(blockList.get(i)); excute.excute(); } } }