public void eval() { String[] split = root.split("or|OR", 2); if (split.length == 2) { evalRecursive(split); op = "OR"; return; } // split = root.split("||", 2); split = root.split("and|AND", 2); if (split.length == 2) { evalRecursive(split); op = "AND"; return; } // split = root.split("&&", 2); if (root.contains(":subc_")) { root = subCond.get(root); eval(); } eval = true; }
ConditionTree t = new ConditionTree(subCond); t.init(); t.setRoot(ex); t.eval(); log.debug("ConditionTree:\n {}", t);
ConditionTree t = new ConditionTree(subCond); t.init(); t.setRoot(ex); t.eval(); log.trace("ConditionTree:\n {}", t);
private Condition createCondition(ConditionTree t) { if (t == null) throw new IllegalArgumentException("Bad ConditionTree \n" + t); // t is LEAF if (t.isLeaf()) { if (t.getRoot().contains("null")) return createNullCondition(t.getRoot()); if (t.getRoot().contains("true") || t.getRoot().contains("TRUE") || t.getRoot().contains("false") || t.getRoot().contains("FALSE")) { return createBooleanCondition(t.getRoot()); } // Hier ist die Magic if (t.getRoot().contains(":p10sete_")) return createSetCondition(t.getRoot()); if (t.getRoot().contains(":p10se")) return createStringCondition(t.getRoot()); return createDoubleCondition(t.getRoot()); } // t is no LEAF if (t.getOp().equals("AND")) return new AndCondition(createCondition(t.left), createCondition(t.right)); if (t.getOp().equals("OR")) return new OrCondition(createCondition(t.left), createCondition(t.right)); throw new IllegalArgumentException("Bad ConditionTree \n" + t); }
private Condition createCondition(ConditionTree t) { if (t == null) throw new IllegalArgumentException("Bad ConditionTree \n" + t); if (t.isLeaf()) { if (t.getRoot().contains("null")) return createNullCondition(t.getRoot()); // Hier ist die Magic if (t.getRoot().contains("p10se")) return createStringCondition(t.getRoot()); return createDoubleCondition(t.getRoot()); } if (t.getOp().equals("AND")) return new AndCondition(createCondition(t.left), createCondition(t.right)); if (t.getOp().equals("OR")) return new OrCondition(createCondition(t.left), createCondition(t.right)); throw new IllegalArgumentException("Bad ConditionTree \n" + t); }
public void init() { left = new ConditionTree(this.subCond); right = new ConditionTree(this.subCond); }
public void init() { left = new ConditionTree(this.subCond); right = new ConditionTree(this.subCond); }