public String getText() { String text = ""; if ( this.expr != null ) { text = this.expr.getText(); } text += predicates.getText(); return text; }
public Object evaluate(Context context) throws JaxenException { return getExpr().evaluate( context ); }
public Expr simplify() { expr = expr.simplify(); return this; }
public String getText() { return getRootExpr().getText(); }
public List evaluateParams(Context context) throws JaxenException { List paramExprs = getParameters(); int paramSize = paramExprs.size(); List paramValues = new ArrayList(paramSize); for (int i = 0; i < paramSize; ++i) { Expr eachParam = (Expr) paramExprs.get(i); Object eachValue = eachParam.evaluate(context); paramValues.add(eachValue); } return paramValues; }
public Expr simplify() { List paramExprs = getParameters(); int paramSize = paramExprs.size(); List newParams = new ArrayList(paramSize); for (int i = 0; i < paramSize; ++i) { Expr eachParam = (Expr) paramExprs.get(i); newParams.add(eachParam.simplify()); } this.parameters = newParams; return this; }
public String getText() { return "-(" + getExpr().getText() + ")"; }
public Object evaluate(Context context) throws JaxenException { Number number = NumberFunction.evaluate( getExpr().evaluate( context ), context.getNavigator() ); return new Double( number.doubleValue() * -1 ); }
public String getText() { return "[" + getExpr().getText() + "]"; }
public List asList(Context context) throws JaxenException { Expr expr = getRootExpr(); Object value = expr.evaluate( context ); List result = DefaultExpr.convertToList( value ); return result; } }
public void simplify() { setExpr( getExpr().simplify() ); }
public Object evaluate(Context context) throws JaxenException { Number lhsValue = NumberFunction.evaluate( getLHS().evaluate( context ), context.getNavigator() ); Number rhsValue = NumberFunction.evaluate( getRHS().evaluate( context ), context.getNavigator() ); double result = lhsValue.doubleValue() - rhsValue.doubleValue(); return new Double( result ); }
public void simplify() { setRootExpr( getRootExpr().simplify() ); }
public String getText() { StringBuffer buf = new StringBuffer(); String prefix = getPrefix(); if (prefix != null && prefix.length() > 0) { buf.append(prefix); buf.append(":"); } buf.append(getFunctionName()); buf.append("("); Iterator paramIter = getParameters().iterator(); while (paramIter.hasNext()) { Expr eachParam = (Expr) paramIter.next(); buf.append(eachParam.getText()); if (paramIter.hasNext()) { buf.append(", "); } } buf.append(")"); return buf.toString(); }
public Object evaluate(Context context) throws JaxenException { Number lhsValue = NumberFunction.evaluate( getLHS().evaluate( context ), context.getNavigator() ); Number rhsValue = NumberFunction.evaluate( getRHS().evaluate( context ), context.getNavigator() ); double result = lhsValue.doubleValue() + rhsValue.doubleValue(); return new Double( result ); }
public Expr simplify() { this.predicates.simplify(); if ( this.expr != null ) { this.expr = this.expr.simplify(); } if ( this.predicates.getPredicates().size() == 0 ) { return getExpr(); } return this; }
public String getText() { StringBuffer buf = new StringBuffer(); if (getFilterExpr() != null) { buf.append(getFilterExpr().getText()); } if (getLocationPath() != null) { if (!getLocationPath().getSteps().isEmpty()) buf.append("/"); buf.append(getLocationPath().getText()); } return buf.toString(); }