/** Accept the visitor. **/ public Object childrenAccept(PartitionParserVisitor visitor, Object data) { if (children != null) { for (int i = 0; i < children.length; ++i) { children[i].jjtAccept(visitor, data); } } return data; }
private Boolean evalSingleTerm(final ASTCOMPARE node, final Object data) { Boolean result = Boolean.FALSE; final Object value = node.jjtGetChild(0).jjtAccept(this, data); if (value != null) { result = Boolean.parseBoolean(value.toString()); } return result; }
private Boolean evalSingleTerm(final ASTCOMPARE node, final Object data) { Boolean result = Boolean.FALSE; final Object value = node.jjtGetChild(0).jjtAccept(this, data); if (value != null) { result = Boolean.parseBoolean(value.toString()); } return result; }
private Boolean evalSingleTerm(final ASTCOMPARE node, final Object data) { Boolean result = Boolean.FALSE; final Object value = node.jjtGetChild(0).jjtAccept(this, data); if (value != null) { result = Boolean.parseBoolean(value.toString()); } return result; }
/** * Compares. * @param node node in the tree * @param data data * @return comparison result */ public Boolean evalCompare(final SimpleNode node, final Object data) { final Object value1 = node.jjtGetChild(0).jjtAccept(this, data); final Compare comparison = (Compare) node.jjtGetChild(1).jjtAccept(this, data); final Object value2 = node.jjtGetChild(2).jjtAccept(this, data); return compare(comparison, value1, value2); }
/** * Compares. * @param node node in the tree * @param data data * @return comparison result */ public Boolean evalCompare(final SimpleNode node, final Object data) { final Object value1 = node.jjtGetChild(0).jjtAccept(this, data); final Compare comparison = (Compare) node.jjtGetChild(1).jjtAccept(this, data); final Object value2 = node.jjtGetChild(2).jjtAccept(this, data); return compare(comparison, value1, value2); }
/** * evalString. * * @param node node * @param data data * @return eval String */ private Expression evalString(final SimpleNode node, final Object data) { final Object lhs = node.jjtGetChild(0).jjtAccept(this, data); final Compare comparison = (Compare) node.jjtGetChild(1).jjtAccept(this, data); final Object rhs = node.jjtGetChild(2).jjtAccept(this, data); return createIcebergExpression(lhs, rhs, comparison); }
@Override public Object visit(final ASTBETWEEN node, final Object data) { final Object value = node.jjtGetChild(0).jjtAccept(this, data); final Object startValue = node.jjtGetChild(1).jjtAccept(this, data); final Object endValue = node.jjtGetChild(2).jjtAccept(this, data); final boolean compare1 = compare(Compare.GTE, value, startValue); final boolean compare2 = compare(Compare.LTE, value, endValue); final boolean result = compare1 && compare2; return node.not != result; }
private Expression evalSingleTerm(final ASTCOMPARE node, final Object data) { final Object value = node.jjtGetChild(0).jjtAccept(this, data); if (value != null) { return Boolean.parseBoolean(value.toString()) ? Expressions.alwaysTrue() : Expressions.alwaysFalse(); } return Expressions.alwaysFalse(); }
@Override public Object visit(final ASTBETWEEN node, final Object data) { final Object value = node.jjtGetChild(0).jjtAccept(this, data); final Object startValue = node.jjtGetChild(1).jjtAccept(this, data); final Object endValue = node.jjtGetChild(2).jjtAccept(this, data); final Expression compare1 = createIcebergExpression(value, startValue, node.not ? Compare.LT : Compare.GTE); final Expression compare2 = createIcebergExpression(value, endValue, node.not ? Compare.GT : Compare.LTE); return (node.not) ? Expressions.or(compare1, compare2) : Expressions.and(compare1, compare2); }