FileDocCategorySizeDatePackage
Large.javaAPI DocApache Poi 3.0.13434Sun Mar 11 12:59:30 GMT 2007org.apache.poi.hssf.record.formula.functions

Large

public class Large extends MultiOperandNumericFunction
author
Amol S. Deshmukh < amolweb at ya hoo dot com >

Fields Summary
private static final org.apache.poi.hssf.record.formula.eval.ValueEvalToNumericXlator
DEFAULT_NUM_XLATOR
Constructors Summary
Methods Summary
public org.apache.poi.hssf.record.formula.eval.Evalevaluate(org.apache.poi.hssf.record.formula.eval.Eval[] operands, int srcCellRow, short srcCellCol)

        ValueEval retval = null;
        double[] ops = getNumberArray(operands, srcCellRow, srcCellCol);
        if (ops == null || ops.length < 2) {
            retval = ErrorEval.VALUE_INVALID;
        }
        else {
            double[] values = new double[ops.length-1];
            int k = (int) ops[ops.length-1];
            System.arraycopy(ops, 0, values, 0, values.length);
            double d = StatsLib.kthLargest(values, k);
            retval = (Double.isNaN(d) || Double.isInfinite(d))
                    ? (ValueEval) ErrorEval.NUM_ERROR
                    : new NumberEval(d);
        }
        
        return retval;
    
protected org.apache.poi.hssf.record.formula.eval.ValueEvalToNumericXlatorgetXlator()
this is the default impl for the factory method getXlator of the super class NumericFunction. Subclasses can override this method if they desire to return a different ValueEvalToNumericXlator instance than the default.

    
                                         
       
        return DEFAULT_NUM_XLATOR;