@Override public boolean equals(Object other) { if (other instanceof CompareAll && super.equals(other)) { CompareAll o = (CompareAll)other; return operator.equals(o.getOperator()); } return false; }
/** * @inheritDoc */ @Override public void meet(CompareAll theOp) throws Exception { mBuffer.append("("); theOp.getArg().visit(this); mBuffer.append(" ").append(theOp.getOperator().getSymbol()).append(" all "); mBuffer.append("("); mBuffer.append(renderTupleExpr(theOp.getSubQuery())); mBuffer.append(")"); mBuffer.append(")"); }
/** * @inheritDoc */ @Override public void meet(CompareAll theOp) throws Exception { mBuffer.append("("); theOp.getArg().visit(this); mBuffer.append(" ").append(theOp.getOperator().getSymbol()).append(" all "); mBuffer.append("("); mBuffer.append(renderTupleExpr(theOp.getSubQuery())); mBuffer.append(")"); mBuffer.append(")"); }
@Override public boolean equals(Object other) { if (other instanceof CompareAll && super.equals(other)) { CompareAll o = (CompareAll)other; return operator.equals(o.getOperator()); } return false; }
/** * @inheritDoc */ @Override public void meet(CompareAll theOp) throws Exception { mBuffer.append("("); theOp.getArg().visit(this); mBuffer.append(" ").append(theOp.getOperator().getSymbol()).append(" all "); mBuffer.append("("); mBuffer.append(renderTupleExpr(theOp.getSubQuery())); mBuffer.append(")"); mBuffer.append(")"); }
/** * @inheritDoc */ @Override public void meet(CompareAll theOp) throws Exception { mBuffer.append("("); theOp.getArg().visit(this); mBuffer.append(" ").append(theOp.getOperator().getSymbol()).append(" all "); mBuffer.append("("); // TODO: query render this theOp.getSubQuery().visit(this); mBuffer.append(")"); mBuffer.append(")"); }
/** * @inheritDoc */ @Override public void meet(CompareAll theOp) throws Exception { mBuffer.append("("); theOp.getArg().visit(this); mBuffer.append(" ").append(theOp.getOperator().getSymbol()).append(" all "); mBuffer.append("("); // TODO: query render this theOp.getSubQuery().visit(this); mBuffer.append(")"); mBuffer.append(")"); }
/** * @inheritDoc */ @Override public void meet(CompareAll theOp) throws Exception { mBuffer.append("("); theOp.getArg().visit(this); mBuffer.append(" ").append(theOp.getOperator().getSymbol()).append(" all "); mBuffer.append("("); // TODO: query render this theOp.getSubQuery().visit(this); mBuffer.append(")"); mBuffer.append(")"); }
/** * Evaluate a {@link CompareAll} node * @param node the node to evaluate * @param bindings the set of named value bindings * @return * @throws ValueExprEvaluationException * @throws QueryEvaluationException */ private Value evaluate(CompareAll node, BindingSet bindings) throws ValueExprEvaluationException, QueryEvaluationException { Value leftValue = evaluate(node.getArg(), bindings); // Result is true until a mismatch has been found boolean result = true; // Use first binding name from tuple expr to compare values String bindingName = node.getSubQuery().getBindingNames().iterator().next(); try (CloseableIteration<BindingSet, QueryEvaluationException> iter = parentStrategy.evaluate(node.getSubQuery(), bindings)) { while (result == true && iter.hasNext()) { BindingSet bindingSet = iter.next(); Value rightValue = bindingSet.getValue(bindingName); try { result = QueryEvaluationUtil.compare(leftValue, rightValue, node.getOperator()); } catch (ValueExprEvaluationException e) { // Exception thrown by ValueCompare.isTrue(...) result = false; } } } return BooleanLiteral.valueOf(result); }
public Value evaluate(CompareAll node, BindingSet bindings) throws ValueExprEvaluationException, QueryEvaluationException { Value leftValue = evaluate(node.getArg(), bindings); // Result is true until a mismatch has been found boolean result = true; // Use first binding name from tuple expr to compare values String bindingName = node.getSubQuery().getBindingNames().iterator().next(); CloseableIteration<BindingSet, QueryEvaluationException> iter = evaluate(node.getSubQuery(), bindings); try { while (result == true && iter.hasNext()) { BindingSet bindingSet = iter.next(); Value rightValue = bindingSet.getValue(bindingName); try { result = QueryEvaluationUtil.compare(leftValue, rightValue, node.getOperator()); } catch (ValueExprEvaluationException e) { // Exception thrown by ValueCompare.isTrue(...) result = false; } } } finally { iter.close(); } return BooleanLiteral.valueOf(result); }
public Value evaluate(CompareAll node, BindingSet bindings) throws ValueExprEvaluationException, QueryEvaluationException { Value leftValue = evaluate(node.getArg(), bindings); // Result is true until a mismatch has been found boolean result = true; // Use first binding name from tuple expr to compare values String bindingName = node.getSubQuery().getBindingNames().iterator().next(); CloseableIteration<BindingSet, QueryEvaluationException> iter = evaluate(node.getSubQuery(), bindings); try { while (result == true && iter.hasNext()) { BindingSet bindingSet = iter.next(); Value rightValue = bindingSet.getValue(bindingName); try { result = QueryEvaluationUtil.compare(leftValue, rightValue, node.getOperator()); } catch (ValueExprEvaluationException e) { // Exception thrown by ValueCompare.isTrue(...) result = false; } } } finally { iter.close(); } return BooleanLiteral.valueOf(result); }