Package org.apache.poi.ss.formula

Examples of org.apache.poi.ss.formula.WorkbookEvaluator$Counter


  /**
   * @param udfFinder pass <code>null</code> for default (AnalysisToolPak only)
   */
  private HSSFFormulaEvaluator(HSSFWorkbook workbook, IStabilityClassifier stabilityClassifier, UDFFinder udfFinder) {
    _bookEvaluator = new WorkbookEvaluator(HSSFEvaluationWorkbook.create(workbook), stabilityClassifier, udfFinder);
  }
View Full Code Here


   * evaluation begins.
   * @deprecated (Sep 2009) (reduce overloading) use {@link #create(XSSFWorkbook, org.apache.poi.ss.formula.IStabilityClassifier, org.apache.poi.ss.formula.udf.UDFFinder)}
   */
    @Deprecated
    public XSSFFormulaEvaluator(XSSFWorkbook workbook, IStabilityClassifier stabilityClassifier) {
    _bookEvaluator = new WorkbookEvaluator(XSSFEvaluationWorkbook.create(workbook), stabilityClassifier, null);
    _book = workbook;
  }
View Full Code Here

    public XSSFFormulaEvaluator(XSSFWorkbook workbook, IStabilityClassifier stabilityClassifier) {
    _bookEvaluator = new WorkbookEvaluator(XSSFEvaluationWorkbook.create(workbook), stabilityClassifier, null);
    _book = workbook;
  }
  private XSSFFormulaEvaluator(XSSFWorkbook workbook, IStabilityClassifier stabilityClassifier, UDFFinder udfFinder) {
    _bookEvaluator = new WorkbookEvaluator(XSSFEvaluationWorkbook.create(workbook), stabilityClassifier, udfFinder);
      _book = workbook;
  }
View Full Code Here

      // formulas are just literal constants "1".."5"
      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.");
    }
View Full Code Here

  private WorkbookEvaluator _evaluator;
  private ForkedEvaluationWorkbook _sewb;

  private ForkedEvaluator(EvaluationWorkbook masterWorkbook, IStabilityClassifier stabilityClassifier) {
    _sewb = new ForkedEvaluationWorkbook(masterWorkbook);
    _evaluator = new WorkbookEvaluator(_sewb, stabilityClassifier);
  }
View Full Code Here

   * @param stabilityClassifier used to optimise caching performance. Pass <code>null</code>
   * for the (conservative) assumption that any cell may have its definition changed after
   * evaluation begins.
   */
  public HSSFFormulaEvaluator(HSSFWorkbook workbook, IStabilityClassifier stabilityClassifier) {
    _bookEvaluator = new WorkbookEvaluator(HSSFEvaluationWorkbook.create(workbook), stabilityClassifier);
  }
View Full Code Here

    row.createCell(0).setCellValue(cal);
   
    // Choose cell A9, so that the failing test case doesn't take too long to execute.
    HSSFCell cell = row.getCell(8);
    EvalListener evalListener = new EvalListener();
    WorkbookEvaluator evaluator = WorkbookEvaluatorTestHelper.createEvaluator(wb, evalListener);
    evaluator.evaluate(HSSFEvaluationTestHelper.wrapCell(cell));
    int evalCount = evalListener.getCountCacheMisses();
    if (evalCount > 10) {
      // Without caching, evaluating cell 'A9' takes 21845 evaluations which consumes
      // much time (~3 sec on Core 2 Duo 2.2GHz)
      System.err.println("Cell A9 took " + evalCount + " intermediate evaluations");
View Full Code Here

      // formulas are just literal constants "1".."5"
      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.");
    }
View Full Code Here

   * evaluation begins.
   * @deprecated (Sep 2009) (reduce overloading) use {@link #create(XSSFWorkbook, org.apache.poi.ss.formula.IStabilityClassifier, org.apache.poi.ss.formula.udf.UDFFinder)}
   */
    @Deprecated
    public XSSFFormulaEvaluator(XSSFWorkbook workbook, IStabilityClassifier stabilityClassifier) {
    _bookEvaluator = new WorkbookEvaluator(XSSFEvaluationWorkbook.create(workbook), stabilityClassifier, null);
    _book = workbook;
  }
View Full Code Here

    public XSSFFormulaEvaluator(XSSFWorkbook workbook, IStabilityClassifier stabilityClassifier) {
    _bookEvaluator = new WorkbookEvaluator(XSSFEvaluationWorkbook.create(workbook), stabilityClassifier, null);
    _book = workbook;
  }
  private XSSFFormulaEvaluator(XSSFWorkbook workbook, IStabilityClassifier stabilityClassifier, UDFFinder udfFinder) {
    _bookEvaluator = new WorkbookEvaluator(XSSFEvaluationWorkbook.create(workbook), stabilityClassifier, udfFinder);
      _book = workbook;
  }
View Full Code Here

TOP

Related Classes of org.apache.poi.ss.formula.WorkbookEvaluator$Counter

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.