Lines 1-5
Link Here
|
1 |
package org.apache.poi.ss.formula.functions; |
1 |
package org.apache.poi.ss.formula.functions; |
2 |
|
2 |
|
|
|
3 |
import org.apache.poi.ss.formula.OperationEvaluationContext; |
3 |
import org.apache.poi.ss.formula.eval.*; |
4 |
import org.apache.poi.ss.formula.eval.*; |
4 |
|
5 |
|
5 |
/** |
6 |
/** |
Lines 30-37
Link Here
|
30 |
* |
31 |
* |
31 |
* @author cedric dot walter @ gmail dot com |
32 |
* @author cedric dot walter @ gmail dot com |
32 |
*/ |
33 |
*/ |
33 |
public class Complex extends Var2or3ArgFunction { |
34 |
public class Complex extends Var2or3ArgFunction implements FreeRefFunction { |
34 |
|
35 |
|
|
|
36 |
public static final FreeRefFunction instance = new Complex(); |
37 |
|
35 |
public static final String DEFAULT_SUFFIX = "i"; |
38 |
public static final String DEFAULT_SUFFIX = "i"; |
36 |
public static final String SUPPORTED_SUFFIX = "j"; |
39 |
public static final String SUPPORTED_SUFFIX = "j"; |
37 |
|
40 |
|
Lines 116-119
Link Here
|
116 |
return (number == Math.floor(number)) && !Double.isInfinite(number); |
119 |
return (number == Math.floor(number)) && !Double.isInfinite(number); |
117 |
} |
120 |
} |
118 |
|
121 |
|
|
|
122 |
@Override |
123 |
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) { |
124 |
if (args.length == 2) { |
125 |
return evaluate(ec.getRowIndex(), ec.getColumnIndex(), args[0], args[1]); |
126 |
} |
127 |
if (args.length == 3) { |
128 |
return evaluate(ec.getRowIndex(), ec.getColumnIndex(), args[0], args[1], args[2]); |
129 |
} |
130 |
|
131 |
return ErrorEval.VALUE_INVALID; |
132 |
} |
119 |
} |
133 |
} |