org.apache.poi.ss.formula.functions
Interface FreeRefFunction

All Known Implementing Classes:
Bin2Dec, Complex, Countifs, Dec2Bin, Dec2Hex, Delta, EDate, EOMonth, FactDouble, Hex2Dec, Imaginary, ImReal, Indirect, Oct2Dec, Quotient, Sumifs, WeekNum

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

When POI evaluates formulas, each reference argument is capable of evaluating any cell inside its range. Actually, even cells outside the reference range but on the same sheet can be evaluated. This allows OFFSET to be implemented like most other functions - taking only the arguments, and source cell coordinates. For the moment this interface only exists to serve the INDIRECT which can decode arbitrary text into cell references, and evaluate them..


Method Summary
 ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec)
           
 

Method Detail

evaluate

ValueEval evaluate(ValueEval[] args,
                   OperationEvaluationContext ec)
Parameters:
args - the pre-evaluated arguments for this function. args is never null, nor are any of its elements.
ec - primarily used to identify the source cell containing the formula being evaluated. may also be used to dynamically create reference evals.
Returns:
never null. Possibly an instance of ErrorEval in the case of a specified Excel error (Exceptions are never thrown to represent Excel errors).