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

Concatenate

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

Fields Summary
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;
        StringBuffer sb = new StringBuffer();
        
        for (int i=0, iSize=operands.length; i<iSize; i++) {
            ValueEval ve = singleOperandEvaluate(operands[i], srcCellRow, srcCellCol);
            if (ve instanceof StringValueEval) {
                StringValueEval sve = (StringValueEval) ve;
                sb.append(sve.getStringValue());
            }
            else if (ve instanceof BlankEval) {}
            else {
                retval = ErrorEval.VALUE_INVALID;
                break;
            }
        }
        
        if (retval == null) {
            retval = new StringEval(sb.toString());
        }
        
        return retval;