/** * @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(")"); }
@Override public int hashCode() { return super.hashCode() ^ operator.hashCode() ^ "CompareAll".hashCode(); }
@Override public void meet(CompareAll node) { if (predicate.equals(SeRQO.OPERATOR)) { Literal lit = (Literal) object; node.setOperator(CompareOp.valueOf(lit.getLabel())); } else { super.meet(node); } }
if (_comp.equals(CompareOp.GE) || _comp.equals(CompareOp.GT)) { if (lower == null) { lower = _bound; equals_lower = _comp.equals(CompareOp.GE); } else { double currentLower = Double.parseDouble(lower.getLabel()); if (newLower > currentLower) { lower = _bound; equals_lower = _comp.equals(CompareOp.GE); } else if (_comp.equals(CompareOp.LE) || _comp.equals(CompareOp.LT)) { if (upper == null) { upper = _bound; equals_upper = _comp.equals(CompareOp.LE); } else { double currentUpper = Double.parseDouble(upper.getLabel()); if (newUpper < currentUpper) { upper = _bound; equals_upper = _comp.equals(CompareOp.LE); } else if (_comp.equals(CompareOp.EQ)) { equal = _bound; if (_comp.equals(CompareOp.GE) || _comp.equals(CompareOp.GT)) { lower = _bound; equals_lower = _comp.equals(CompareOp.GE); replace = true;
if (_comp.equals(CompareOp.GE) || _comp.equals(CompareOp.GT)) { if (lower == null) { lower = _bound; equals_lower = _comp.equals(CompareOp.GE); } else { double currentLower = Double.parseDouble(lower.getLabel()); if (newLower > currentLower) { lower = _bound; equals_lower = _comp.equals(CompareOp.GE); } else if (_comp.equals(CompareOp.LE) || _comp.equals(CompareOp.LT)) { if (upper == null) { upper = _bound; equals_upper = _comp.equals(CompareOp.LE); } else { double currentUpper = Double.parseDouble(upper.getLabel()); if (newUpper < currentUpper) { upper = _bound; equals_upper = _comp.equals(CompareOp.LE); } else if (_comp.equals(CompareOp.EQ)) { equal = _bound; if (_comp.equals(CompareOp.GE) || _comp.equals(CompareOp.GT)) { lower = _bound; equals_lower = _comp.equals(CompareOp.GE); replace = true;
ValueExpr right = ((Compare) condition).getRightArg(); if (comp.equals(CompareOp.NE)) { replaceFilter = false; replaceFilter = NUMERIC_RANGETYPES_AS_STRING.contains(dts) || DATETIME_RANGETYPES_AS_STRING.contains(dts) || (comp.equals(CompareOp.EQ) && dts.equals(XMLSchema.STRING)); } else if (v instanceof Literal && ((Literal) v).getDatatype() == null) { replaceFilter = comp.equals(CompareOp.EQ); } else { replaceFilter = false;
ValueExpr right = ((Compare) condition).getRightArg(); if (comp.equals(CompareOp.NE)) { replaceFilter = false; replaceFilter = NUMERIC_RANGETYPES_AS_STRING.contains(dts) || DATETIME_RANGETYPES_AS_STRING.contains(dts) || (comp.equals(CompareOp.EQ) && dts.equals(XMLSchema.STRING)); } else if (v instanceof Literal && ((Literal) v).getDatatype() == null) { replaceFilter = comp.equals(CompareOp.EQ); } else { replaceFilter = false;
@Override final public FunctionNode visit(ASTCompare node, Object data) throws VisitorException { final URI functionURI; switch (node.getOperator()) { case LT: functionURI = FunctionRegistry.LT; break; case GT: functionURI = FunctionRegistry.GT; break; case EQ: functionURI = FunctionRegistry.EQ; break; case LE: functionURI = FunctionRegistry.LE; break; case GE: functionURI = FunctionRegistry.GE; break; case NE: functionURI = FunctionRegistry.NE; break; default: throw new UnsupportedOperationException(node.getOperator() .getSymbol()); } return binary(node, functionURI); }
@Override final public FunctionNode visit(ASTCompare node, Object data) throws VisitorException { final URI functionURI; switch (node.getOperator()) { case LT: functionURI = FunctionRegistry.LT; break; case GT: functionURI = FunctionRegistry.GT; break; case EQ: functionURI = FunctionRegistry.EQ; break; case LE: functionURI = FunctionRegistry.LE; break; case GE: functionURI = FunctionRegistry.GE; break; case NE: functionURI = FunctionRegistry.NE; break; default: throw new UnsupportedOperationException(node.getOperator() .getSymbol()); } return binary(node, functionURI); }
/** * @inheritDoc */ @Override public void meet(CompareAny theOp) throws Exception { mBuffer.append("("); theOp.getArg().visit(this); mBuffer.append(" ").append(theOp.getOperator().getSymbol()).append(" any "); mBuffer.append("("); // TODO: query render this theOp.getSubQuery().visit(this); mBuffer.append(")"); mBuffer.append(")"); }
/** * @inheritDoc */ @Override public void meet(CompareAny theOp) throws Exception { mBuffer.append("("); theOp.getArg().visit(this); mBuffer.append(" ").append(theOp.getOperator().getSymbol()).append(" any "); 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 String getSignature() { return super.getSignature() + " (" + operator.getSymbol() + ")"; }
@Override public String getSignature() { return super.getSignature() + " (" + operator.getSymbol() + ")"; }
/** * @inheritDoc */ @Override public void meet(Compare theOp) throws Exception { mBuffer.append("("); theOp.getLeftArg().visit(this); mBuffer.append(" ").append(theOp.getOperator().getSymbol()).append(" "); theOp.getRightArg().visit(this); mBuffer.append(")"); }
/** * @inheritDoc */ @Override public void meet(Compare theOp) throws Exception { mBuffer.append("("); theOp.getLeftArg().visit(this); mBuffer.append(" ").append(theOp.getOperator().getSymbol()).append(" "); theOp.getRightArg().visit(this); mBuffer.append(")"); }
@Override public void meet(Compare node) { if (predicate.equals(SeRQO.OPERATOR)) { Literal lit = (Literal) object; node.setOperator(CompareOp.valueOf(lit.getLabel())); } else { super.meet(node); } }
@Override public void meet(CompareAll node) { handleType(SeRQO.COMPAREALL); handleLiteral(SeRQO.OPERATOR, node.getOperator().name()); super.meet(node); }
@Override public String getSignature() { return super.getSignature() + " (" + operator.getSymbol() + ")"; }
@Override public int hashCode() { return super.hashCode() ^ operator.hashCode(); }