Package org.apache.poi.ss.formula
Class OperationEvaluationContext
- java.lang.Object
-
- org.apache.poi.ss.formula.OperationEvaluationContext
-
public final class OperationEvaluationContext extends Object
Contains all the contextual information required to evaluate an operation within a formula For POI internal use only
-
-
Field Summary
Fields Modifier and Type Field Description static FreeRefFunctionUDF
-
Constructor Summary
Constructors Constructor Description OperationEvaluationContext(WorkbookEvaluator bookEvaluator, EvaluationWorkbook workbook, int sheetIndex, int srcRowNum, int srcColNum, org.apache.poi.ss.formula.EvaluationTracker tracker)OperationEvaluationContext(WorkbookEvaluator bookEvaluator, EvaluationWorkbook workbook, int sheetIndex, int srcRowNum, int srcColNum, org.apache.poi.ss.formula.EvaluationTracker tracker, boolean isSingleValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FreeRefFunctionfindUserDefinedFunction(String functionName)ValueEvalgetArea3DEval(Area3DPtg aptg)ValueEvalgetArea3DEval(Area3DPxg aptg)ValueEvalgetAreaEval(int firstRowIndex, int firstColumnIndex, int lastRowIndex, int lastColumnIndex)ValueEvalgetAreaValueEval(int firstRowIndex, int firstColumnIndex, int lastRowIndex, int lastColumnIndex, Object[][] tokens)intgetColumnIndex()ValueEvalgetDynamicReference(String workbookName, String sheetName, String refStrPart1, String refStrPart2, boolean isA1Style)Resolves a cell or area reference dynamically.ValueEvalgetNameXEval(NameXPtg nameXPtg)ValueEvalgetNameXEval(NameXPxg nameXPxg)ValueEvalgetRef3DEval(Ref3DPtg rptg)ValueEvalgetRef3DEval(Ref3DPxg rptg)ValueEvalgetRefEval(int rowIndex, int columnIndex)org.apache.poi.ss.formula.SheetRangeEvaluatorgetRefEvaluatorForCurrentSheet()intgetRowIndex()intgetSheetIndex()EvaluationWorkbookgetWorkbook()booleanisArraymode()booleanisSingleValue()default truevoidsetArrayMode(boolean value)
-
-
-
Field Detail
-
UDF
public static final FreeRefFunction UDF
-
-
Constructor Detail
-
OperationEvaluationContext
public OperationEvaluationContext(WorkbookEvaluator bookEvaluator, EvaluationWorkbook workbook, int sheetIndex, int srcRowNum, int srcColNum, org.apache.poi.ss.formula.EvaluationTracker tracker)
-
OperationEvaluationContext
public OperationEvaluationContext(WorkbookEvaluator bookEvaluator, EvaluationWorkbook workbook, int sheetIndex, int srcRowNum, int srcColNum, org.apache.poi.ss.formula.EvaluationTracker tracker, boolean isSingleValue)
-
-
Method Detail
-
isArraymode
public boolean isArraymode()
-
setArrayMode
public void setArrayMode(boolean value)
-
getWorkbook
public EvaluationWorkbook getWorkbook()
-
getRowIndex
public int getRowIndex()
-
getColumnIndex
public int getColumnIndex()
-
getRefEvaluatorForCurrentSheet
public org.apache.poi.ss.formula.SheetRangeEvaluator getRefEvaluatorForCurrentSheet()
-
getDynamicReference
public ValueEval getDynamicReference(String workbookName, String sheetName, String refStrPart1, String refStrPart2, boolean isA1Style)
Resolves a cell or area reference dynamically.- Parameters:
workbookName- the name of the workbook containing the reference. Ifnullthe current workbook is assumed. Note - to evaluate formulas which use multiple workbooks, aCollaboratingWorkbooksEnvironmentmust be set up.sheetName- the name of the sheet containing the reference. May benull(when workbookName is also null) in which case the current workbook and sheet is assumed.refStrPart1- the single cell reference or first part of the area reference. Must not benull.refStrPart2- the second part of the area reference. For single cell references this parameter must benullisA1Style- specifies the format for refStrPart1 and refStrPart2. Passtruefor 'A1' style andfalsefor 'R1C1' style. TODO - currently POI only supports 'A1' reference style- Returns:
- a
RefEvalorAreaEval
-
findUserDefinedFunction
public FreeRefFunction findUserDefinedFunction(String functionName)
-
getRefEval
public ValueEval getRefEval(int rowIndex, int columnIndex)
-
getAreaEval
public ValueEval getAreaEval(int firstRowIndex, int firstColumnIndex, int lastRowIndex, int lastColumnIndex)
-
getAreaValueEval
public ValueEval getAreaValueEval(int firstRowIndex, int firstColumnIndex, int lastRowIndex, int lastColumnIndex, Object[][] tokens)
-
getSheetIndex
public int getSheetIndex()
-
isSingleValue
public boolean isSingleValue()
default true- Returns:
- flag indicating whether evaluation should "unwrap" the result to a single value based on the context row/column
-
-