|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator
public class HSSFFormulaEvaluator
Nested Class Summary | |
---|---|
static class |
HSSFFormulaEvaluator.CellValue
Mimics the 'data view' of a cell. |
Field Summary | |
---|---|
protected HSSFRow |
row
|
protected HSSFSheet |
sheet
|
protected HSSFWorkbook |
workbook
|
Constructor Summary | |
---|---|
HSSFFormulaEvaluator(HSSFSheet sheet,
HSSFWorkbook workbook)
|
Method Summary | |
---|---|
HSSFFormulaEvaluator.CellValue |
evaluate(HSSFCell cell)
If cell contains a formula, the formula is evaluated and returned, else the CellValue simply copies the appropriate cell value from the cell and also its cell type. |
static void |
evaluateAllFormulaCells(HSSFWorkbook wb)
Loops over all cells in all sheets of the supplied workbook. |
static AreaEval |
evaluateArea3dPtg(HSSFWorkbook workbook,
Area3DPtg a3dp)
|
static AreaEval |
evaluateAreaPtg(HSSFSheet sheet,
HSSFWorkbook workbook,
AreaPtg ap)
|
int |
evaluateFormulaCell(HSSFCell cell)
If cell contains formula, it evaluates the formula, and saves the result of the formula. |
HSSFCell |
evaluateInCell(HSSFCell cell)
If cell contains formula, it evaluates the formula, and puts the formula result back into the cell, in place of the old formula. |
protected static HSSFFormulaEvaluator.CellValue |
getCellValueForEval(ValueEval eval)
Returns a CellValue wrapper around the supplied ValueEval instance. |
protected static ValueEval |
getEvalForCell(HSSFCell cell,
HSSFRow row,
HSSFSheet sheet,
HSSFWorkbook workbook)
Given a cell, find its type and from that create an appropriate ValueEval impl instance and return that. |
protected static Eval |
getEvalForPtg(Ptg ptg)
returns an appropriate Eval impl instance for the Ptg. |
static FormulaParser |
getUnderlyingParser(HSSFWorkbook workbook,
java.lang.String formula)
Returns an underlying FormulaParser, for the specified Formula String and HSSFWorkbook. |
void |
setCurrentRow(HSSFRow row)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected HSSFRow row
protected HSSFSheet sheet
protected HSSFWorkbook workbook
Constructor Detail |
---|
public HSSFFormulaEvaluator(HSSFSheet sheet, HSSFWorkbook workbook)
Method Detail |
---|
public void setCurrentRow(HSSFRow row)
public static FormulaParser getUnderlyingParser(HSSFWorkbook workbook, java.lang.String formula)
public HSSFFormulaEvaluator.CellValue evaluate(HSSFCell cell)
cell
- public int evaluateFormulaCell(HSSFCell cell)
int evaluatedCellType = evaluator.evaluateFormulaCell(cell);Be aware that your cell will hold both the formula, and the result. If you want the cell replaced with the result of the formula, use
evaluateInCell(HSSFCell)
cell
- The cell to evaluate
public HSSFCell evaluateInCell(HSSFCell cell)
int evaluatedCellType = evaluator.evaluateInCell(cell).getCellType();Be aware that your cell value will be changed to hold the result of the formula. If you simply want the formula value computed for you, use
evaluateFormulaCell(HSSFCell)
cell
- public static void evaluateAllFormulaCells(HSSFWorkbook wb)
protected static HSSFFormulaEvaluator.CellValue getCellValueForEval(ValueEval eval)
eval
- public static AreaEval evaluateAreaPtg(HSSFSheet sheet, HSSFWorkbook workbook, AreaPtg ap)
public static AreaEval evaluateArea3dPtg(HSSFWorkbook workbook, Area3DPtg a3dp)
protected static Eval getEvalForPtg(Ptg ptg)
ptg
- protected static ValueEval getEvalForCell(HSSFCell cell, HSSFRow row, HSSFSheet sheet, HSSFWorkbook workbook)
cell
- sheet
- workbook
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |