/** * Get the string representation. * @return The string representation. */ public String toString() { StringBuffer sbuf = new StringBuffer(); sbuf.append("("); sbuf.append(getValueSource()); sbuf.append(getOperator()); if(vars.size()>1) { sbuf.append("("); for(int i=0; i<vars.size(); i++) { sbuf.append(vars.get(i)); } sbuf.append(")"); } else { sbuf.append(vars.get(0)); } sbuf.append(")"); return sbuf.toString(); } }
/** * Get the string representation. * @return The string representation. */ public String toString() { StringBuffer sbuf = new StringBuffer(); sbuf.append("("); sbuf.append(getValueSource()); sbuf.append(getOperator()); if(vars.size()>1) { sbuf.append("("); for(int i=0; i<vars.size(); i++) { sbuf.append(vars.get(i)); } sbuf.append(")"); } else { sbuf.append(vars.get(0)); } sbuf.append(")"); return sbuf.toString(); } }
if(bc.getOperator().equals(IOperator.EQUAL))
if(bc.getOperator().equals(IOperator.EQUAL))
/** * Test if all needed variables are available from the condition directly. * All variables must be declared as BoundConstraints with equal operator * in this object condition. * @return True, if can be evaluated in alpha network. */ protected boolean isAlphaExecutable(ICondition cond, IConstraint c) { boolean ret = cond instanceof ObjectCondition; if(ret) { Set available = new HashSet(); ObjectCondition ocond = (ObjectCondition)cond; List consts = ocond.getBoundConstraints(); for(int i = 0; i < consts.size(); i++) { BoundConstraint bc = (BoundConstraint)consts.get(i); if(bc.getOperator().equals(IOperator.EQUAL) && available.containsAll(Constraint.getVariablesForValueSource(bc.getValueSource()))) { available.addAll(bc.getBindVariables()); } } ret = available.containsAll(c.getVariables()); } return ret; }
/** * Test if all needed variables are available from the condition directly. * All variables must be declared as BoundConstraints with equal operator * in this object condition. * @return True, if can be evaluated in alpha network. */ protected boolean isAlphaExecutable(ICondition cond, IConstraint c) { boolean ret = cond instanceof ObjectCondition; if(ret) { Set available = new HashSet(); ObjectCondition ocond = (ObjectCondition)cond; List consts = ocond.getBoundConstraints(); for(int i = 0; i < consts.size(); i++) { BoundConstraint bc = (BoundConstraint)consts.get(i); if(bc.getOperator().equals(IOperator.EQUAL) && available.containsAll(Constraint.getVariablesForValueSource(bc.getValueSource()))) { available.addAll(bc.getBindVariables()); } } ret = available.containsAll(c.getVariables()); } return ret; }
if(bc.getOperator().equals(IOperator.EQUAL))
if(bc.getOperator().equals(IOperator.EQUAL))
if(bc.getOperator().equals(IOperator.EQUAL)) if(c instanceof BoundConstraint && ((BoundConstraint)c).getOperator().equals(IOperator.EQUAL))
if(bc.getOperator().equals(IOperator.EQUAL)) if(c instanceof BoundConstraint && ((BoundConstraint)c).getOperator().equals(IOperator.EQUAL))
&& IOperator.EQUAL.equals(((BoundConstraint)c).getOperator()) && !(((BoundConstraint)c).getValueSource() instanceof MethodCall) && !(((BoundConstraint)c).getValueSource() instanceof FunctionCall)
&& IOperator.EQUAL.equals(((BoundConstraint)c).getOperator()) && !(((BoundConstraint)c).getValueSource() instanceof MethodCall) && !(((BoundConstraint)c).getValueSource() instanceof FunctionCall)
IOperator op = bc.getOperator(); IValueExtractor ex1 = createValueExtractor(-1, bc.getValueSource(), subindex, context, false); IValueExtractor ex2 = getRightVariableExtractor(context, var); ret.add(new ConstraintEvaluator(bc.getOperator(), ex1, ex2)); int subindex = bc.isMultiConstraint()? i: -1; IValueExtractor rightex = createValueExtractor(-1, bc.getValueSource(), subindex, context, false); IOperator op = bc.getOperator();
IOperator op = bc.getOperator(); IValueExtractor ex1 = createValueExtractor(-1, bc.getValueSource(), subindex, context, false); IValueExtractor ex2 = getRightVariableExtractor(context, var); ret.add(new ConstraintEvaluator(bc.getOperator(), ex1, ex2)); int subindex = bc.isMultiConstraint()? i: -1; IValueExtractor rightex = createValueExtractor(-1, bc.getValueSource(), subindex, context, false); IOperator op = bc.getOperator();