@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; }
@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; }
@Override public Object visit(final ASTLIKE node, final Object data) { final Object value1 = node.jjtGetChild(0).jjtAccept(this, data); final Object value2 = node.jjtGetChild(1).jjtAccept(this, data); final boolean result = compare(Compare.LIKE, value1, value2); return node.not != result; }
@Override public Object visit(final ASTLIKE node, final Object data) { final Object value1 = node.jjtGetChild(0).jjtAccept(this, data); final Object value2 = node.jjtGetChild(1).jjtAccept(this, data); final boolean result = compare(Compare.LIKE, value1, value2); return node.not != 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); }