Examples of evaluate()


Examples of org.apache.poi.hssf.record.formula.functions.Function.evaluate()

    public Eval evaluate(Eval[] operands, int srcRow, short srcCol) {
        Eval retval = null;
        Function f = getFunction();
        if (f != null)
            retval = f.evaluate(operands, srcRow, srcCol);
        else
            retval = ErrorEval.FUNCTION_NOT_IMPLEMENTED;
        return retval;
    }

Examples of org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluate()

    HSSFCell cell = row.createCell(0);
    cell.setCellFormula("1+IF(1,,)");
    HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb);
    CellValue cv;
    try {
      cv = fe.evaluate(cell);
    } catch (RuntimeException e) {
      throw new AssertionFailedError("Missing arg result not being handled correctly.");
    }
    assertEquals(HSSFCell.CELL_TYPE_NUMERIC, cv.getCellType());
    // adding blank to 1.0 gives 1.0

Examples of org.apache.poi.ss.formula.WorkbookEvaluator.evaluate()

      row.createCell(i).setCellFormula(String.valueOf(i));
    }

    EvalCountListener evalListener = new EvalCountListener();
    WorkbookEvaluator evaluator = WorkbookEvaluatorTestHelper.createEvaluator(wb, evalListener);
    ValueEval ve = evaluator.evaluate(HSSFEvaluationTestHelper.wrapCell(cellA1));
    int evalCount = evalListener.getEvalCount();
    if (evalCount == 6) {
      // Without short-circuit-if evaluation, evaluating cell 'A1' takes 3 extra evaluations (for D1,E1,F1)
      throw new AssertionFailedError("Identifed bug 48195 - Formula evaluator should short-circuit IF() calculations.");
    }

Examples of org.apache.poi.ss.formula.functions.FreeRefFunction.evaluate()

      throw new NotImplementedFunctionException(functionName);
    }
    int nOutGoingArgs = nIncomingArgs -1;
    ValueEval[] outGoingArgs = new ValueEval[nOutGoingArgs];
    System.arraycopy(args, 1, outGoingArgs, 0, nOutGoingArgs);
    return targetFunc.evaluate(outGoingArgs, ec);
  }
}

Examples of org.apache.poi.ss.formula.functions.Function.evaluate()

      throw new IllegalArgumentException("ptg must not be null");
    }
    Function result = _instancesByPtgClass.get(ptg);

    if (result != null) {
      return  result.evaluate(args, ec.getRowIndex(), (short) ec.getColumnIndex());
    }

    if (ptg instanceof AbstractFunctionPtg) {
      AbstractFunctionPtg fptg = (AbstractFunctionPtg)ptg;
      int functionIndex = fptg.getFunctionIndex();

Examples of org.apache.poi.ss.usermodel.FormulaEvaluator.evaluate()

          cfn.setCellFormula("A1")
          Cell cfs = r.createCell(3, Cell.CELL_TYPE_FORMULA);
          cfs.setCellFormula("B1");
         
          FormulaEvaluator fe = wb.getCreationHelper().createFormulaEvaluator();
          assertEquals(Cell.CELL_TYPE_NUMERIC, fe.evaluate(cfn).getCellType());
          assertEquals(Cell.CELL_TYPE_STRING, fe.evaluate(cfs).getCellType());
          fe.evaluateFormulaCell(cfn);
          fe.evaluateFormulaCell(cfs);
         
          // Now test

Examples of org.apache.poi.xslf.model.geom.Context.evaluate()

        };

        CustomGeometry geom = new CustomGeometry(CTCustomGeometry2D.Factory.newInstance());
        Context ctx = new Context(geom, null, null);
        for(Formula fmla : ops) {
            ctx.evaluate(fmla);
        }

        assertEquals(100.0, ctx.getValue("adj1"));
        assertEquals(200.0, ctx.getValue("adj2"));
        assertEquals(1.0, ctx.getValue("a1"));

Examples of org.apache.qpid.qmf2.common.QmfQuery.evaluate()

                {
                    object.addSubscription(subscription.getSubscriptionId(), subscription);
                    object.publish();
                }
            }
            else if (query.evaluate(object))
            {
                object.addSubscription(subscription.getSubscriptionId(), subscription);
                object.publish();
            }
        }

Examples of org.apache.servicemix.expression.Expression.evaluate()

            public Object evaluate(MessageExchange messageExchange,
                                   NormalizedMessage normalizedMessage) throws MessagingException {
                Object[] answer = new Object[parameterExpressions.length];
                for (int i = 0; i < parameterExpressions.length; i++) {
                    Expression parameterExpression = parameterExpressions[i];
                    answer[i] = parameterExpression.evaluate(messageExchange, normalizedMessage);
                }
                return answer;
            }
        };
    }

Examples of org.apache.servicemix.expression.JAXPBooleanXPathExpression.evaluate()

    public boolean xpath(String xpath) throws Exception {
        JAXPBooleanXPathExpression expression = new JAXPBooleanXPathExpression(xpath);
        if (this.namespaceContext != null) {
            expression.setNamespaceContext(this.namespaceContext);
        }
        Boolean b = (Boolean) expression.evaluate(null, message);
        return b.booleanValue();
    }
   
    public String valueOf(String xpath) throws Exception {
        JAXPStringXPathExpression expression = new JAXPStringXPathExpression(xpath);
TOP
Copyright © 2018 www.massapi.com. 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.