/** * Creates a copy of this expression node, without copying children. */ public Expression shallowCopy() { return new ASTAnd(id); }
public ASTAnd(Object[] nodes) { super(ExpressionParserTreeConstants.JJTAND); int len = nodes.length; for (int i = 0; i < len; i++) { jjtAddChild((Node) nodes[i], i); } connectChildren(); }
protected Object evaluateNode(Object o) throws Exception { int len = jjtGetNumChildren(); if (len == 0) { return Boolean.FALSE; } for (int i = 0; i < len; i++) { if (!ConversionUtil.toBoolean(evaluateChild(i, o))) { return Boolean.FALSE; } } return Boolean.TRUE; }
public void injectValue(Object o) { // iterate through all operands, inject all possible int len = jjtGetNumChildren(); for (int i = 0; i < len; i++) { Node node = jjtGetChild(i); if (node instanceof ValueInjector) { ((ValueInjector) node).injectValue(o); } } } }
@Override public void jjtClose() { super.jjtClose(); flattenTree(); }
public void jjtClose() { super.jjtClose(); flattenTree(); }
public ASTAnd(Object[] nodes) { super(ExpressionParserTreeConstants.JJTAND); int len = nodes.length; for (int i = 0; i < len; i++) { jjtAddChild((Node) nodes[i], i); } connectChildren(); }
@Override protected Object evaluateNode(Object o) throws Exception { int len = jjtGetNumChildren(); if (len == 0) { return Boolean.FALSE; } // https://en.wikipedia.org/wiki/Three-valued_logic boolean unknown = false; boolean result = true; for (int i = 0; i < len; i++) { Object value = evaluateChild(i, o); if (value == null) { unknown = true; } else if (!ConversionUtil.toBoolean(value)) { result = false; break; } } return result ? (unknown ? null : Boolean.TRUE) : Boolean.FALSE; }
/** * Creates a copy of this expression node, without copying children. */ @Override public Expression shallowCopy() { return new ASTAnd(id); }
public ASTAnd(Collection nodes) { super(ExpressionParserTreeConstants.JJTAND); int len = nodes.size(); Iterator it = nodes.iterator(); for (int i = 0; i < len; i++) { jjtAddChild((Node) it.next(), i); } connectChildren(); }
ASTAnd jjtn001 = new ASTAnd(JJTAND); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001);
public ASTAnd(Collection<? extends Node> nodes) { super(ExpressionParserTreeConstants.JJTAND); int len = nodes.size(); Iterator<? extends Node> it = nodes.iterator(); for (int i = 0; i < len; i++) { jjtAddChild(it.next(), i); } connectChildren(); }
ASTAnd jjtn001 = new ASTAnd(JJTAND); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001);