Package org.apache.poi.hssf.record.formula.eval

Examples of org.apache.poi.hssf.record.formula.eval.OperationEval


                // parens can be ignored since we have RPN tokens
                if (optg instanceof ParenthesisPtg) { continue; }
                if (optg instanceof AttrPtg) { continue; }
                if (optg instanceof UnionPtg) { continue; }

                OperationEval operation = (OperationEval) getOperationEvalForPtg(optg);

                int numops = operation.getNumberOfOperands();
                Eval[] ops = new Eval[numops];

                // storing the ops in reverse order since they are popping
                for (int j = numops - 1; j >= 0; j--) {
                    Eval p = (Eval) stack.pop();
                    ops[j] = p;
                }
                Eval opresult = operation.evaluate(ops, srcRowNum, srcColNum);
                stack.push(opresult);
            }
            else if (ptgs[i] instanceof ReferencePtg) {
                ReferencePtg ptg = (ReferencePtg) ptgs[i];
                short colnum = ptg.getColumn();
View Full Code Here


            if (ptg instanceof OperationPtg) {
                OperationPtg optg = (OperationPtg) ptg;

                if (optg instanceof UnionPtg) { continue; }

                OperationEval operation = OperationEvaluatorFactory.create(optg);

                int numops = operation.getNumberOfOperands();
                Eval[] ops = new Eval[numops];

                // storing the ops in reverse order since they are popping
                for (int j = numops - 1; j >= 0; j--) {
                    Eval p = (Eval) stack.pop();
View Full Code Here

      if (ptg instanceof OperationPtg) {
        OperationPtg optg = (OperationPtg) ptg;

        if (optg instanceof UnionPtg) { continue; }

        OperationEval operation = OperationEvaluatorFactory.create(optg);

        int numops = operation.getNumberOfOperands();
        ValueEval[] ops = new ValueEval[numops];

        // storing the ops in reverse order since they are popping
        for (int j = numops - 1; j >= 0; j--) {
          ValueEval p = stack.pop();
View Full Code Here

   */
  public static OperationEval create(OperationPtg ptg) {
    if(ptg == null) {
      throw new IllegalArgumentException("ptg must not be null");
    }
    OperationEval result;

    Class<? extends OperationPtg> ptgClass = ptg.getClass();

    result = _instancesByPtgClass.get(ptgClass);
    if (result != null) {
View Full Code Here

    try {
      if (target instanceof Function) {
        Function ff = (Function) target;
        evalResult = ff.evaluate(args, srcCellRow, (short)srcCellCol);
      } else {
        OperationEval ff = (OperationEval) target;
        evalResult = ff.evaluate(args, srcCellRow, (short)srcCellCol);
      }
    } catch (NotImplementedException e) {
      throw new NumericEvalEx("Not implemented:" + e.getMessage());
    }
   
View Full Code Here

                // parens can be ignored since we have RPN tokens
                if (optg instanceof ParenthesisPtg) { continue; }
                if (optg instanceof AttrPtg) { continue; }
                if (optg instanceof UnionPtg) { continue; }

                OperationEval operation = OperationEvaluatorFactory.create(optg);

                int numops = operation.getNumberOfOperands();
                Eval[] ops = new Eval[numops];

                // storing the ops in reverse order since they are popping
                for (int j = numops - 1; j >= 0; j--) {
                    Eval p = (Eval) stack.pop();
View Full Code Here

    // TODO - make OperationEval extend Function
    if (target instanceof Function) {
      Function ff = (Function) target;
      evalResult = ff.evaluate(args, srcCellRow, (short)srcCellCol);
    } else {
      OperationEval ff = (OperationEval) target;
      evalResult = ff.evaluate(args, srcCellRow, (short)srcCellCol);
    }
   
    if(evalResult == null) {
      throw new NumericEvalEx("Result object was null");
    }
View Full Code Here

      if (ptg instanceof OperationPtg) {
        OperationPtg optg = (OperationPtg) ptg;

        if (optg instanceof UnionPtg) { continue; }

        OperationEval operation = OperationEvaluatorFactory.create(optg);

        int numops = operation.getNumberOfOperands();
        ValueEval[] ops = new ValueEval[numops];

        // storing the ops in reverse order since they are popping
        for (int j = numops - 1; j >= 0; j--) {
          ValueEval p = stack.pop();
View Full Code Here

      if (ptg instanceof OperationPtg) {
        OperationPtg optg = (OperationPtg) ptg;

        if (optg instanceof UnionPtg) { continue; }

        OperationEval operation = OperationEvaluatorFactory.create(optg);

        int numops = operation.getNumberOfOperands();
        ValueEval[] ops = new ValueEval[numops];

        // storing the ops in reverse order since they are popping
        for (int j = numops - 1; j >= 0; j--) {
          ValueEval p = stack.pop();
          ops[j] = p;
        }
//        logDebug("invoke " + operation + " (nAgs=" + numops + ")");
        opResult = operation.evaluate(ops, ec);
        if (opResult == MissingArgEval.instance) {
          opResult = BlankEval.INSTANCE;
        }
      } else {
        opResult = getEvalForPtg(ptg, ec);
View Full Code Here

   */
  public static OperationEval create(OperationPtg ptg) {
    if(ptg == null) {
      throw new IllegalArgumentException("ptg must not be null");
    }
    OperationEval result;

    Class<? extends OperationPtg> ptgClass = ptg.getClass();

    result = _instancesByPtgClass.get(ptgClass);
    if (result != null) {
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.record.formula.eval.OperationEval

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.