org.apache.poi.hssf.record.formula.functions
Interface FreeRefFunction

All Known Implementing Classes:
Indirect

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

Method Summary
 ValueEval evaluate(Eval[] args, EvaluationWorkbook workbook, int srcCellSheet, int srcCellRow, int srcCellCol)
           
 

Method Detail

evaluate

ValueEval evaluate(Eval[] args,
                   EvaluationWorkbook workbook,
                   int srcCellSheet,
                   int srcCellRow,
                   int srcCellCol)
Parameters:
args - the pre-evaluated arguments for this function. args is never null, nor are any of its elements.
srcCellSheet - zero based sheet index of the cell containing the currently evaluating formula
srcCellRow - zero based row index of the cell containing the currently evaluating formula
srcCellCol - zero based column index of the cell containing the currently evaluating formula
workbook - is the workbook 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.