Package org.objectweb.medor.expression.lib

Examples of org.objectweb.medor.expression.lib.BasicOperand


      return null;
    }

    public Object visit(ASTLiteral node, Object data) {
      if (node.value instanceof Integer) {
        ((Stack) data).push(new BasicOperand(((Integer) node.value).intValue()));
      } else if (node.value instanceof Float) {
        ((Stack) data).push(new BasicOperand(((Float) node.value).floatValue()));
      } else if (node.value instanceof Character) {
        ((Stack) data).push(new BasicOperand(((Character) node.value).charValue()));
      } else if (node.value instanceof String) {
        String s = (String) (node.value);
        s = s.substring(1, s.length() - 1);
        ((Stack) data).push(new BasicOperand(s));
      } else if (node.value instanceof Boolean) {
        ((Stack) data).push(new BasicOperand(((Boolean) node.value).booleanValue()));
      }
      return null;
    }
View Full Code Here


      logger.log(BasicLevel.DEBUG, "Visit Type: " + node);
      return null;
    }

    public Object visit(ASTQualifiedName node, Object data) {
      ((Stack) data).push(new BasicOperand((String) node.value));
      return null;
    }
View Full Code Here

  }
  protected java.lang.Class getJavaFieldType() {
      return Long.TYPE;
  }
  protected BasicOperand getBasicOperand() {
    return new BasicOperand(1l << 44);
  }
View Full Code Here

  }
  protected PType getFieldType() {
      return PTypeSpace.OBJLONG;
  }
  protected BasicOperand getBasicOperand() {
    return new BasicOperand(new Long(1l << 44), PTypeSpace.OBJLONG);
  }
View Full Code Here

              } catch (Exception e) {
                throw new SpeedoException(
                    "Try to replace null node. Impossible to find the null PName for the type " + ptype.getJormName(), e);
              }
              //replace the null node with null PName
              op.setExpression(i, new BasicOperand(val, ptype));
            } else {
                //Transform the null [not]equality into a IsNull operator
                me = new ME(new IsNull(other, exprFilter instanceof NotEqual));
                //recursion is done on the other operand
                exprFilter = me.e;
View Full Code Here

    Expression e = null;
    if (node.value == null) {
      //special case for null: will be replaced later
      e = new DummyOperand();
    } else if (node.value instanceof Integer) {
            e = new BasicOperand(((Integer) node.value).intValue());
        } else if (node.value instanceof Float) {
            e = new BasicOperand(((Float) node.value).floatValue());
        } else if (node.value instanceof Character) {
            e = new BasicOperand(((Character) node.value).charValue());
        } else if (node.value instanceof String) {
            String s = (String) (node.value);
            s = s.substring(1, s.length()-1);
            e = new BasicOperand(s);
        } else if (node.value instanceof Boolean) {
            e = new BasicOperand(((Boolean) node.value).booleanValue());
    }
    if (stack.size() > 0) {
      Object top = stack.peek();
      if (CONTAINS_PATH_SET.equals(top)) {
//TODO: Support the path.contains(path) operator
View Full Code Here

        Expression str = (Expression) oe;
        if (e instanceof BasicParameterOperand) {
            e = new StringComparatorParameterOperand((BasicParameterOperand) e, null, ".*");
        } else  if (e instanceof BasicOperand) {
          try {
            e = new BasicOperand(((BasicOperand) e).getString() + ".*");
          } catch (TypingException e1) {
            throw new JDOException(
              "Bad parameter type for the 'startsWith' method", e1);
          }
        }
        e = new Like(str, e);
        break;
      }
    case ENDS_WITH_OPERATOR:
      {
          stack.pop();
        Object oe = stack.pop();
                if (debug) {
                    logger.log(BasicLevel.DEBUG, "pop expression: " + oe);
                }
        Expression str = (Expression) oe;
        if (e instanceof BasicParameterOperand) {
            e = new StringComparatorParameterOperand((BasicParameterOperand) e, ".*", null);
        } else  if (e instanceof BasicOperand) {
          try {
            e = new BasicOperand("%" + ((BasicOperand) e).getString());
          } catch (TypingException e1) {
            throw new JDOException(
              "Bad parameter type for the 'startsWith' method", e1);
          }
        }
        e = new Like(str, e);
        break;
      }
    case EQUALS_OPERATOR:
//TODO: Support the equals operator
      break;
    case MATCHES_OPERATOR:
      {
          stack.pop();
        Object oe = stack.pop();
                if (debug) {
                    logger.log(BasicLevel.DEBUG, "pop expression: " + oe);
                }
        Expression str = (Expression) oe;
        if (e instanceof BasicParameterOperand) {
            //e = new StringComparatorParameterOperand((BasicParameterOperand) e, "%", "%");
        } else  if (e instanceof BasicOperand) {
          try {
            e = new BasicOperand(((BasicOperand) e).getString());
          } catch (TypingException e1) {
            throw new JDOException(
              "Bad parameter type for the 'startsWith' method", e1);
          }
        }
View Full Code Here

TOP

Related Classes of org.objectweb.medor.expression.lib.BasicOperand

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.