Package com.meidusa.amoeba.sqljep.function

Examples of com.meidusa.amoeba.sqljep.function.Comparative


  @Override
  public Comparable evaluate(Object[] parameters) {
    if(expression != null){
      Comparable<?> comparable = expression.evaluate(parameters);
      if(comparable != null){
        return new Comparative(comparison,comparable);
      }else{
        return null;
      }
    }else{
      return null;
View Full Code Here


    Comparable<?> source = comparables[0];
    if (source == null || limit1 == null || limit2 == null) {
      return (Boolean.FALSE);
    } else {
      if (source instanceof Comparative) {
        Comparative other = (Comparative) source;
        boolean result = other.intersect(
            Comparative.GreaterThanOrEqual, limit1,
            ComparativeComparator.comparator);
        result = result
            && other.intersect(Comparative.LessThanOrEqual, limit2,
                ComparativeComparator.comparator);
        return (result);
      } else {
        return (ComparativeComparator.compareTo(source, limit1) >= 0 && ComparativeComparator
            .compareTo(source, limit2) <= 0);
View Full Code Here

        }else{
          runtime.stack.push(list);
        }
      }else{
        //分析每个参数是否是 Comparative 类型
        Comparative lastComparative = null;
        for(int i=0;i<parameters.length;i++){
          if(parameters[i] instanceof Comparative){
            lastComparative = ((Comparative) parameters[i]);
            parameters[i] =((Comparative) parameters[i]).getValue();
          }
        }

        Comparable<?> result = pfmc.getResult(parameters);
        if(lastComparative != null){
          lastComparative.setValue(result);
          result = lastComparative;
        }
        if(pfmc instanceof Declare){
          Declare declare = (Declare) pfmc;
          declare.declare(runtime, result);
View Full Code Here

        int childSize = arg.jjtGetNumChildren();

        for (int i = 0; i < childSize; i++) {
          Comparable<?> d = runtime.stack.pop();
          if (source instanceof Comparative) {
            Comparative other = (Comparative) source;
            boolean result = other.intersect(
                Comparative.Equivalent, d,
                ComparativeComparator.comparator);
            if (result) {
              runtime.stack.setSize(runtime.stack.size()
                  - (childSize - i - 1));
View Full Code Here

                Map<Column, Comparative> columnMap = tablesMap.get(table);
                if (columnMap == null) {
                    columnMap = new HashMap<Column, Comparative>();
                    tablesMap.put(table, columnMap);
                }
                Comparative col = columnMap.get(colExpression.getColumn());
                Comparative newComparative = (Comparative) colExpression.evaluate(parameters);
                if (col != null) {
                  if(col instanceof ComparativeBaseList){
                    ComparativeBaseList source = (ComparativeBaseList)col;
                    if((source instanceof ComparativeAND && and) || (source instanceof ComparativeOR && !and)){
                      source.addComparative(newComparative);
View Full Code Here

TOP

Related Classes of com.meidusa.amoeba.sqljep.function.Comparative

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.