Package org.openrdf.query.algebra

Examples of org.openrdf.query.algebra.ValueExpr


  @Override
  public Integer visit(ASTWhere node, Object data)
    throws VisitorException
  {
    ValueExpr valueExpr = (ValueExpr)node.getCondition().jjtAccept(this, null);
    graphPattern.addConstraint(valueExpr);
    return null;
  }
View Full Code Here


  @Override
  public Var visit(ASTEdge node, Object data)
    throws VisitorException
  {
    ValueExpr arg = (ValueExpr)node.getValueExpr().jjtAccept(this, null);

    if (arg instanceof Var) {
      return (Var)arg;
    }
    else if (arg instanceof ValueConstant) {
      ValueConstant vc = (ValueConstant)arg;
      return createConstantVar(vc.getValue());
    }
    else {
      throw new IllegalArgumentException("Unexpected edge argument type: " + arg.getClass());
    }
  }
View Full Code Here

  @Override
  public Var visit(ASTNodeElem node, Object data)
    throws VisitorException
  {
    ValueExpr valueExpr = (ValueExpr)node.getChild().jjtAccept(this, null);

    if (valueExpr instanceof Var) {
      return (Var)valueExpr;
    }
    else if (valueExpr instanceof ValueConstant) {
      ValueConstant vc = (ValueConstant)valueExpr;
      return createConstantVar(vc.getValue());
    }
    else {
      throw new IllegalArgumentException("Unexpected node element result type: " + valueExpr.getClass());
    }
  }
View Full Code Here

  public ValueExpr visit(ASTOr node, Object data)
    throws VisitorException
  {
    Iterator<ASTBooleanExpr> iter = node.getOperandList().iterator();

    ValueExpr result = (ValueExpr)iter.next().jjtAccept(this, null);

    while (iter.hasNext()) {
      ValueExpr operand = (ValueExpr)iter.next().jjtAccept(this, null);
      result = new Or(result, operand);
    }

    return result;
  }
View Full Code Here

  public ValueExpr visit(ASTAnd node, Object data)
    throws VisitorException
  {
    Iterator<ASTBooleanExpr> iter = node.getOperandList().iterator();

    ValueExpr result = (ValueExpr)iter.next().jjtAccept(this, null);

    while (iter.hasNext()) {
      ValueExpr operand = (ValueExpr)iter.next().jjtAccept(this, null);
      result = new And(result, operand);
    }

    return result;
  }
View Full Code Here

  @Override
  public Compare visit(ASTCompare node, Object data)
    throws VisitorException
  {
    ValueExpr leftArg = (ValueExpr)node.getLeftOperand().jjtAccept(this, null);
    ValueExpr rightArg = (ValueExpr)node.getRightOperand().jjtAccept(this, null);
    CompareOp operator = node.getOperator().getValue();

    return new Compare(leftArg, rightArg, operator);
  }
View Full Code Here

  @Override
  public CompareAny visit(ASTCompareAny node, Object data)
    throws VisitorException
  {
    ValueExpr valueExpr = (ValueExpr)node.getLeftOperand().jjtAccept(this, null);
    TupleExpr tupleExpr = (TupleExpr)node.getRightOperand().jjtAccept(this, null);
    CompareOp op = node.getOperator().getValue();

    return new CompareAny(valueExpr, tupleExpr, op);
  }
View Full Code Here

  @Override
  public CompareAll visit(ASTCompareAll node, Object data)
    throws VisitorException
  {
    ValueExpr valueExpr = (ValueExpr)node.getLeftOperand().jjtAccept(this, null);
    TupleExpr tupleExpr = (TupleExpr)node.getRightOperand().jjtAccept(this, null);
    CompareOp op = node.getOperator().getValue();

    return new CompareAll(valueExpr, tupleExpr, op);
  }
View Full Code Here

  @Override
  public Like visit(ASTLike node, Object data)
    throws VisitorException
  {
    ValueExpr expr = (ValueExpr)node.getValueExpr().jjtAccept(this, null);
    String pattern = (String)node.getPattern().jjtAccept(this, null);
    boolean caseSensitive = !node.ignoreCase();

    return new Like(expr, pattern, caseSensitive);
  }
View Full Code Here

  @Override
  public In visit(ASTIn node, Object data)
    throws VisitorException
  {
    ValueExpr valueExpr = (ValueExpr)node.getLeftOperand().jjtAccept(this, null);
    TupleExpr tupleExpr = (TupleExpr)node.getRightOperand().jjtAccept(this, null);
    return new In(valueExpr, tupleExpr);
  }
View Full Code Here

TOP

Related Classes of org.openrdf.query.algebra.ValueExpr

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.