Package org.openrdf.sail.rdbms.algebra

Examples of org.openrdf.sail.rdbms.algebra.FalseValue


      else {
        expr = or(expr, new SqlEq(compare.clone(), value));
      }
    }
    if (expr == null) {
      return new FalseValue();
    }
    return expr;
  }
View Full Code Here


  private SqlExpr valueOf(Value value) {
    if (value instanceof Literal) {
      if (((Literal)value).booleanValue()) {
        return new TrueValue();
      }
      return new FalseValue();
    }
    return sqlNull();
  }
View Full Code Here

    throws RuntimeException
  {
    super.meet(node);
    for (SqlExpr arg : node.getArgs()) {
      if (arg instanceof FalseValue) {
        replace(node, new FalseValue());
        return;
      }
      else if (arg instanceof SqlNull) {
        replace(node, new SqlNull());
        return;
      }
      else if (arg instanceof TrueValue) {
        node.removeChildNode(arg);
      }
      else if (arg instanceof SqlNot) {
        SqlNot not = (SqlNot)arg;
        List<SqlExpr> args = Arrays.asList(node.getArgs());
        if (args.contains(not.getArg())) {
          replace(node, new FalseValue());
          return;
        }
      }
    }
    if (node.getNumberOfArguments() == 0) {
View Full Code Here

      SqlConstant<?> r = (SqlConstant<?>)right;
      if (l.getValue().equals(r.getValue())) {
        replace(node, new TrueValue());
      }
      else {
        replace(node, new FalseValue());
      }
    }
  }
View Full Code Here

    SqlExpr arg = node.getArg();
    if (arg instanceof SqlNull) {
      replace(node, new TrueValue());
    }
    else if (arg instanceof SqlConstant<?>) {
      replace(node, new FalseValue());
    }
    else if (arg instanceof SqlCase) {
      SqlExpr rep = null;
      SqlExpr prev = null;
      SqlCase scase = (SqlCase)arg;
View Full Code Here

    throws RuntimeException
  {
    super.meet(node);
    SqlExpr arg = node.getArg();
    if (arg instanceof TrueValue) {
      replace(node, new FalseValue());
    }
    else if (arg instanceof FalseValue) {
      replace(node, new TrueValue());
    }
    else if (arg instanceof SqlNull) {
View Full Code Here

      else if (arg instanceof SqlNull) {
        sqlNull = arg;
      }
    }
    if (node.getNumberOfArguments() == 0) {
      replace(node, new FalseValue());
    }
    else if (node.getNumberOfArguments() == 1) {
      replace(node, node.getArg(0));
    }
    else if (sqlNull != null) {
View Full Code Here

  private SqlExpr valueOf(Value value) {
    if (value instanceof Literal) {
      if (((Literal)value).booleanValue()) {
        return new TrueValue();
      }
      return new FalseValue();
    }
    return sqlNull();
  }
View Full Code Here

      else {
        expr = or(expr, new SqlEq(compare.clone(), value));
      }
    }
    if (expr == null)
      return new FalseValue();
    return expr;
  }
View Full Code Here

  {
    super.meet(node);
    SqlExpr left = node.getLeftArg();
    SqlExpr right = node.getRightArg();
    if (left instanceof FalseValue || right instanceof FalseValue) {
      replace(node, new FalseValue());
    }
    else if (left instanceof TrueValue && right instanceof TrueValue) {
      replace(node, new TrueValue());
    }
    else if (left instanceof TrueValue) {
      replace(node, right.clone());
    }
    else if (right instanceof TrueValue) {
      replace(node, left.clone());
    }
    else if (right instanceof SqlNull || left instanceof SqlNull) {
      replace(node, new SqlNull());
    }
    else if (right instanceof SqlNot && ((SqlNot)right).getArg().equals(left)) {
      replace(node, new FalseValue());
    }
    else if (left instanceof SqlNot && ((SqlNot)left).getArg().equals(right)) {
      replace(node, new FalseValue());
    }
  }
View Full Code Here

TOP

Related Classes of org.openrdf.sail.rdbms.algebra.FalseValue

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.