org.apache.poi.hssf.record.formula.functions
Interface FreeRefFunction
- All Known Implementing Classes:
- Indirect, Offset
public interface FreeRefFunction
For most Excel functions, involving references ((cell, area), (2d, 3d)), the references are
passed in as arguments, and the exact location remains fixed. However, a select few Excel
functions have the ability to access cells that were not part of any reference passed as an
argument.
Two important functions with this feature are INDIRECT and OFFSET
In POI, the HSSFFormulaEvaluator evaluates every cell in each reference argument before
calling the function. This means that functions using fixed references do not need access to
the rest of the workbook to execute. Hence the evaluate() method on the common
interface Function does not take a workbook parameter.
This interface recognises the requirement of some functions to freely create and evaluate
references beyond those passed in as arguments.
- Author:
- Josh Micich
evaluate
ValueEval evaluate(Eval[] args,
int srcCellRow,
short srcCellCol,
HSSFWorkbook workbook,
HSSFSheet sheet)
- Parameters:
args
- the pre-evaluated arguments for this function. args is never null
,
nor are any of its elements.srcCellRow
- zero based row index of the cell containing the currently evaluating formulasrcCellCol
- zero based column index of the cell containing the currently evaluating formulaworkbook
- is the workbook containing the formula/cell being evaluatedsheet
- is the sheet containing the formula/cell being evaluated
- Returns:
- never
null
. Possibly an instance of ErrorEval in the case of
a specified Excel error (Exceptions are never thrown to represent Excel errors).
Copyright 2008 The Apache Software Foundation or
its licensors, as applicable.