/** * Creates a copy of this expression node, without copying children. */ @Override public Expression shallowCopy() { return new ASTDivide(id); }
public ASTDivide(Object[] nodes) { super(ExpressionParserTreeConstants.JJTDIVIDE); int len = nodes.length; for (int i = 0; i < len; i++) { jjtAddChild(wrapChild(nodes[i]), i); } connectChildren(); }
public void jjtClose() { super.jjtClose(); flattenTree(); } }
protected Object evaluateNode(Object o) throws Exception { int len = jjtGetNumChildren(); if (len == 0) { return null; } BigDecimal result = null; for (int i = 0; i < len; i++) { BigDecimal value = ConversionUtil.toBigDecimal(evaluateChild(i, o)); if (value == null) { return null; } result = (i == 0) ? value : result.divide(value, BigDecimal.ROUND_HALF_EVEN); } return result; }
@Override public void jjtClose() { super.jjtClose(); flattenTree(); } }
public ASTDivide(Collection<?> nodes) { super(ExpressionParserTreeConstants.JJTDIVIDE); int len = nodes.size(); Iterator<?> it = nodes.iterator(); for (int i = 0; i < len; i++) { jjtAddChild(wrapChild(it.next()), i); } connectChildren(); }
/** * Creates a copy of this expression node, without copying children. */ public Expression shallowCopy() { return new ASTDivide(id); }
public ASTDivide(Collection nodes) { super(ExpressionParserTreeConstants.JJTDIVIDE); int len = nodes.size(); Iterator it = nodes.iterator(); for (int i = 0; i < len; i++) { jjtAddChild(wrapChild(it.next()), i); } connectChildren(); }
case 27: jj_consume_token(27); ASTDivide jjtn002 = new ASTDivide(JJTDIVIDE); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002);
case 23: jj_consume_token(23); ASTDivide jjtn002 = new ASTDivide(JJTDIVIDE); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002);