Top Description Fields Constructors Methods
org.apache.poi.ss.formula.functions

public final Class Indirect

extends Object
implements FreeRefFunction
Class Inheritance
All Implemented Interfaces
org.apache.poi.ss.formula.functions.FreeRefFunction
Imports
org.apache.logging.log4j.LogManager, .Logger, org.apache.poi.ss.formula.FormulaParseException, .FormulaParser, .FormulaParsingWorkbook, .OperationEvaluationContext, org.apache.poi.ss.formula.eval.BlankEval, .ErrorEval, .EvaluationException, .MissingArgEval, .OperandResolver, .ValueEval, org.apache.poi.ss.formula.ptg.Area3DPxg, org.apache.poi.ss.usermodel.Table

Implementation for Excel function INDIRECT

INDIRECT() returns the cell or area reference denoted by the text argument.

Syntax:
INDIRECT(ref_text,isA1Style)

ref_text a string representation of the desired reference as it would normally be written in a cell formula.
isA1Style (default TRUE) specifies whether the ref_text should be interpreted as A1-style or R1C1-style.

Field Summary

Modifier and TypeField and Description
public static final FreeRefFunction
private static final Logger

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static boolean
public ValueEval
evaluate(ValueEval[]
the pre-evaluated arguments for this function. args is never null, nor are any of its elements.
args
,
OperationEvaluationContext
primarily used to identify the source cell containing the formula being evaluated. may also be used to dynamically create reference evals.
ec
)

Implements org.apache.poi.ss.formula.functions.FreeRefFunction.evaluate.

private static boolean
private static ValueEval
evaluateIndirect(final OperationEvaluationContext ec, String text, boolean isA1style)

private static String[]

Returns:

array of length 2: {workbookName, sheetName,}. Second element will always be present. First element may be null if sheetName is unqualified. Returns null if text cannot be parsed.
parseWorkbookAndSheetName
(CharSequence text)

private static String

Returns:

null if there is a syntax error in any escape sequence (the typical syntax error is a single quote character not followed by another).
unescapeString
(CharSequence text)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

instanceback to summary
public static final FreeRefFunction instance
LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

Indirectback to summary
private Indirect()

Method Detail

canTrimback to summary
private static boolean canTrim(CharSequence text)
evaluateback to summary
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec)

Implements org.apache.poi.ss.formula.functions.FreeRefFunction.evaluate.

Parameters
args:ValueEval[]

Doc from org.apache.poi.ss.formula.functions.FreeRefFunction.evaluate.

the pre-evaluated arguments for this function. args is never null, nor are any of its elements.

ec:OperationEvaluationContext

Doc from org.apache.poi.ss.formula.functions.FreeRefFunction.evaluate.

primarily used to identify the source cell containing the formula being evaluated. may also be used to dynamically create reference evals.

Returns:ValueEval

Doc from org.apache.poi.ss.formula.functions.FreeRefFunction.evaluate.

never null. Possibly an instance of ErrorEval in the case of a specified Excel error (Exceptions are never thrown to represent Excel errors).

Annotations
@Override
evaluateBooleanArgback to summary
private static boolean evaluateBooleanArg(ValueEval arg, OperationEvaluationContext ec) throws EvaluationException
evaluateIndirectback to summary
private static ValueEval evaluateIndirect(final OperationEvaluationContext ec, String text, boolean isA1style)
parseWorkbookAndSheetNameback to summary
private static String[] parseWorkbookAndSheetName(CharSequence text)
Returns:String[]

array of length 2: {workbookName, sheetName,}. Second element will always be present. First element may be null if sheetName is unqualified. Returns null if text cannot be parsed.

unescapeStringback to summary
private static String unescapeString(CharSequence text)
Returns:String

null if there is a syntax error in any escape sequence (the typical syntax error is a single quote character not followed by another).