@Override public void notifyUpdateCell(Cell cell) { _bookEvaluator.notifyUpdateCell(new HSSFEvaluationCell((HSSFCell)cell)); } /**
@Override public Ptg[] getFormulaTokens(EvaluationCell evalCell) { HSSFCell cell = ((HSSFEvaluationCell)evalCell).getHSSFCell(); // re-parsing the formula text also works, but is a waste of time // return HSSFFormulaParser.parse(cell.getCellFormula(), _uBook, FormulaType.CELL, _uBook.getSheetIndex(cell.getSheet())); // It is useful within the tests to make sure that all formulas POI can evaluate can also be parsed. // see HSSFFileHandler.handleFile instead FormulaRecordAggregate fra = (FormulaRecordAggregate) cell.getCellValueRecord(); return fra.getFormulaTokens(); }
/** * @since POI 3.15 beta 3 * @deprecated POI 3.15 beta 3. * Will be deleted when we make the CellType enum transition. See bug 59791. */ @Deprecated @Removal(version = "4.2") @Override public CellType getCachedFormulaResultTypeEnum() { return getCachedFormulaResultType(); } }
/** * @since POI 3.15 beta 3 * @deprecated POI 3.15 beta 3. */ @Deprecated @Removal(version = "4.2") @Override public CellType getCellTypeEnum() { return getCellType(); } @Override
/** * @since POI 3.15 beta 3 * @deprecated POI 3.15 beta 3. */ @Deprecated @Removal(version = "4.2") @Override public CellType getCellTypeEnum() { return getCellType(); } @Override
/** * Should be called to tell the cell value cache that the specified cell has just been * deleted. * Failure to call this method after changing cell values will cause incorrect behaviour * of the evaluate~ methods of this class */ public void notifyDeleteCell(HSSFCell cell) { _bookEvaluator.notifyDeleteCell(new HSSFEvaluationCell(cell)); } @Override
@Override public Ptg[] getFormulaTokens(EvaluationCell evalCell) { HSSFCell cell = ((HSSFEvaluationCell)evalCell).getHSSFCell(); // re-parsing the formula text also works, but is a waste of time // return HSSFFormulaParser.parse(cell.getCellFormula(), _uBook, FormulaType.CELL, _uBook.getSheetIndex(cell.getSheet())); // It is useful within the tests to make sure that all formulas POI can evaluate can also be parsed. // see HSSFFileHandler.handleFile instead FormulaRecordAggregate fra = (FormulaRecordAggregate) cell.getCellValueRecord(); return fra.getFormulaTokens(); }
/** * @since POI 3.15 beta 3 * @deprecated POI 3.15 beta 3. * Will be deleted when we make the CellType enum transition. See bug 59791. */ @Deprecated @Removal(version = "4.2") @Override public CellType getCachedFormulaResultTypeEnum() { return getCachedFormulaResultType(); } }
@Override public void notifyDeleteCell(Cell cell) { _bookEvaluator.notifyDeleteCell(new HSSFEvaluationCell((HSSFCell)cell)); }
public Ptg[] getFormulaTokens(EvaluationCell evalCell) { HSSFCell cell = ((HSSFEvaluationCell)evalCell).getHSSFCell(); if (false) { // re-parsing the formula text also works, but is a waste of time // It is useful from time to time to run all unit tests with this code // to make sure that all formulas POI can evaluate can also be parsed. try { return HSSFFormulaParser.parse(cell.getCellFormula(), _uBook, FormulaType.CELL, _uBook.getSheetIndex(cell.getSheet())); } catch (FormulaParseException e) { // Note - as of Bugzilla 48036 (svn r828244, r828247) POI is capable of evaluating // IntesectionPtg. However it is still not capable of parsing it. // So FormulaEvalTestData.xls now contains a few formulas that produce errors here. System.err.println(e.getMessage()); } } FormulaRecordAggregate fra = (FormulaRecordAggregate) cell.getCellValueRecord(); return fra.getFormulaTokens(); } public UDFFinder getUDFFinder(){
/** * Should be called to tell the cell value cache that the specified (value or formula) cell * has changed. * Failure to call this method after changing cell values will cause incorrect behaviour * of the evaluate~ methods of this class */ public void notifyUpdateCell(HSSFCell cell) { _bookEvaluator.notifyUpdateCell(new HSSFEvaluationCell(cell)); } @Override
public Ptg[] getFormulaTokens(EvaluationCell evalCell) { HSSFCell cell = ((HSSFEvaluationCell)evalCell).getHSSFCell(); if (false) { // re-parsing the formula text also works, but is a waste of time // It is useful from time to time to run all unit tests with this code // to make sure that all formulas POI can evaluate can also be parsed. try { return HSSFFormulaParser.parse(cell.getCellFormula(), _uBook, FormulaType.CELL, _uBook.getSheetIndex(cell.getSheet())); } catch (FormulaParseException e) { // Note - as of Bugzilla 48036 (svn r828244, r828247) POI is capable of evaluating // IntesectionPtg. However it is still not capable of parsing it. // So FormulaEvalTestData.xls now contains a few formulas that produce errors here. logger.log( POILogger.ERROR, e.getMessage()); } } FormulaRecordAggregate fra = (FormulaRecordAggregate) cell.getCellValueRecord(); return fra.getFormulaTokens(); } public UDFFinder getUDFFinder(){
/** * Should be called to tell the cell value cache that the specified (value or formula) cell * has changed. * Failure to call this method after changing cell values will cause incorrect behaviour * of the evaluate~ methods of this class */ @Override public void notifySetFormula(Cell cell) { _bookEvaluator.notifyUpdateCell(new HSSFEvaluationCell((HSSFCell)cell)); }
@Override public EvaluationCell getCell(int rowIndex, int columnIndex) { HSSFRow row = _hs.getRow(rowIndex); if (row == null) { return null; } HSSFCell cell = row.getCell(columnIndex); if (cell == null) { return null; } return new HSSFEvaluationCell(cell, this); }
/** * Returns a CellValue wrapper around the supplied ValueEval instance. * @param cell */ protected CellValue evaluateFormulaCellValue(Cell cell) { ValueEval eval = _bookEvaluator.evaluate(new HSSFEvaluationCell((HSSFCell)cell)); if (eval instanceof BoolEval) { BoolEval be = (BoolEval) eval; return CellValue.valueOf(be.getBooleanValue()); } if (eval instanceof NumericValueEval) { NumericValueEval ne = (NumericValueEval) eval; return new CellValue(ne.getNumberValue()); } if (eval instanceof StringValueEval) { StringValueEval ne = (StringValueEval) eval; return new CellValue(ne.getStringValue()); } if (eval instanceof ErrorEval) { return CellValue.getError(((ErrorEval)eval).getErrorCode()); } throw new RuntimeException("Unexpected eval class (" + eval.getClass().getName() + ")"); }
/** * Should be called to tell the cell value cache that the specified (value or formula) cell * has changed. * Failure to call this method after changing cell values will cause incorrect behaviour * of the evaluate~ methods of this class */ public void notifyUpdateCell(HSSFCell cell) { _bookEvaluator.notifyUpdateCell(new HSSFEvaluationCell(cell)); } @Override
/** * Should be called to tell the cell value cache that the specified cell has just been * deleted. * Failure to call this method after changing cell values will cause incorrect behaviour * of the evaluate~ methods of this class */ public void notifyDeleteCell(HSSFCell cell) { _bookEvaluator.notifyDeleteCell(new HSSFEvaluationCell(cell)); } @Override
/** * Should be called to tell the cell value cache that the specified (value or formula) cell * has changed. * Failure to call this method after changing cell values will cause incorrect behaviour * of the evaluate~ methods of this class */ public void notifyUpdateCell(HSSFCell cell) { _bookEvaluator.notifyUpdateCell(new HSSFEvaluationCell(cell)); } public void notifyUpdateCell(Cell cell) {
/** * Should be called to tell the cell value cache that the specified (value or formula) cell * has changed. * Failure to call this method after changing cell values will cause incorrect behaviour * of the evaluate~ methods of this class */ public void notifySetFormula(Cell cell) { _bookEvaluator.notifyUpdateCell(new HSSFEvaluationCell((HSSFCell)cell)); }
/** * Should be called to tell the cell value cache that the specified (value or formula) cell * has changed. * Failure to call this method after changing cell values will cause incorrect behaviour * of the evaluate~ methods of this class */ @Override public void notifySetFormula(Cell cell) { _bookEvaluator.notifyUpdateCell(new HSSFEvaluationCell((HSSFCell)cell)); }