org.apache.poi.hssf.record.formula.functions
Class MultiOperandNumericFunction
java.lang.Object
org.apache.poi.hssf.record.formula.functions.NumericFunction
org.apache.poi.hssf.record.formula.functions.MultiOperandNumericFunction
- All Implemented Interfaces:
- Function
- Direct Known Subclasses:
- Avedev, Average, Devsq, Large, Max, Maxa, Median, Min, Mina, Mode, Product, Small, Stdev, Sum, Sumsq
public abstract class MultiOperandNumericFunction
- extends NumericFunction
- Author:
- Amol S. Deshmukh < amolweb at ya hoo dot com >
This is the super class for all excel function evaluator
classes that take variable number of operands, and
where the order of operands does not matter
Fields inherited from class org.apache.poi.hssf.record.formula.functions.NumericFunction |
E, PI |
Method Summary |
protected static boolean |
areSubArraysConsistent(double[][] values)
Ensures that a two dimensional array has all sub-arrays present and the same length |
protected int |
getMaxNumOperands()
Maximum number of operands accepted by this function. |
protected double[] |
getNumberArray(Eval[] operands,
int srcRow,
short srcCol)
Returns a double array that contains values for the numeric cells
from among the list of operands. |
protected double[] |
getNumberArray(Eval operand,
int srcRow,
short srcCol)
Same as getNumberArray(Eval[], int, short) except that this
takes Eval instead of Eval[]. |
protected abstract ValueEvalToNumericXlator |
getXlator()
this is the default impl of the factory(ish) method getXlator. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.poi.hssf.record.formula.functions.Function |
evaluate |
MultiOperandNumericFunction
public MultiOperandNumericFunction()
getXlator
protected abstract ValueEvalToNumericXlator getXlator()
- Description copied from class:
NumericFunction
- this is the default impl of the factory(ish) method getXlator.
Subclasses can override this method
if they desire to return a different ValueEvalToNumericXlator instance
than the default.
- Overrides:
getXlator
in class NumericFunction
getMaxNumOperands
protected int getMaxNumOperands()
- Maximum number of operands accepted by this function.
Subclasses may override to change default value.
getNumberArray
protected double[] getNumberArray(Eval[] operands,
int srcRow,
short srcCol)
- Returns a double array that contains values for the numeric cells
from among the list of operands. Blanks and Blank equivalent cells
are ignored. Error operands or cells containing operands of type
that are considered invalid and would result in #VALUE! error in
excel cause this function to return
null
.
- Parameters:
operands
- srcRow
- srcCol
-
getNumberArray
protected double[] getNumberArray(Eval operand,
int srcRow,
short srcCol)
- Same as getNumberArray(Eval[], int, short) except that this
takes Eval instead of Eval[].
- Parameters:
operand
- srcRow
- srcCol
-
areSubArraysConsistent
protected static final boolean areSubArraysConsistent(double[][] values)
- Ensures that a two dimensional array has all sub-arrays present and the same length
- Returns:
false
if any sub-array is missing, or is of different length
Copyright 2008 The Apache Software Foundation or
its licensors, as applicable.