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

public Class Complex

extends Var2or3ArgFunction
implements FreeRefFunction
Class Inheritance
All Implemented Interfaces
org.apache.poi.ss.formula.functions.FreeRefFunction
Imports
java.util.Locale, org.apache.poi.ss.formula.OperationEvaluationContext, org.apache.poi.ss.formula.eval.ErrorEval, .EvaluationException, .OperandResolver, .StringEval, .ValueEval

Implementation for Excel COMPLEX () function.

Syntax:
COMPLEX (real_num,i_num,suffix )

Converts real and imaginary coefficients into a complex number of the form x + yi or x + yj.

All complex number functions accept "i" and "j" for suffix, but neither "I" nor "J". Using uppercase results in the #VALUE! error value. All functions that accept two or more complex numbers require that all suffixes match.

real_num The real coefficient of the complex number. If this argument is nonnumeric, this function returns the #VALUE! error value.

i_num The imaginary coefficient of the complex number. If this argument is nonnumeric, this function returns the #VALUE! error value.

suffix The suffix for the imaginary component of the complex number.

Field Summary

Modifier and TypeField and Description
public static final String
public static final FreeRefFunction
public static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ValueEval
public ValueEval
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 boolean
isDoubleAnInt(double number)

Inherited from org.apache.poi.ss.formula.functions.Var2or3ArgFunction:
evaluate

Field Detail

DEFAULT_SUFFIXback to summary
public static final String DEFAULT_SUFFIX
instanceback to summary
public static final FreeRefFunction instance
SUPPORTED_SUFFIXback to summary
public static final String SUPPORTED_SUFFIX

Constructor Detail

Complexback to summary
public Complex()

Method Detail

evaluateback to summary
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval real_num, ValueEval i_num)

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

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

see Function#evaluate(ValueEval[], int, int)

Annotations
@Override
evaluateback to summary
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval real_num, ValueEval i_num, ValueEval suffix)

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

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

see Function#evaluate(ValueEval[], int, int)

Annotations
@Override
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
isDoubleAnIntback to summary
private boolean isDoubleAnInt(double number)