FileDocCategorySizeDatePackage
StringOperationEval.javaAPI DocApache Poi 3.0.13131Sun Mar 11 12:59:28 GMT 2007org.apache.poi.hssf.record.formula.eval

StringOperationEval

public abstract class StringOperationEval extends Object implements OperationEval
author
Amol S. Deshmukh < amolweb at ya hoo dot com >

Fields Summary
Constructors Summary
Methods Summary
private org.apache.poi.hssf.record.formula.eval.ValueEvalinternalResolveEval(Eval eval)

        ValueEval retval;
        if (eval instanceof StringValueEval) {
            retval = (StringValueEval) eval;
        }
        else if (eval instanceof RefEval) {
            RefEval re = (RefEval) eval;
            ValueEval tve = re.getInnerValueEval();
            if (tve instanceof StringValueEval || tve instanceof BlankEval) {
                retval = tve;
            }
            else {
                retval = ErrorEval.NAME_INVALID;
            }
        }
        else if (eval instanceof BlankEval) {
            retval = (BlankEval) eval;
        }
        else {
            retval = ErrorEval.NAME_INVALID;
        }
        return retval;
    
protected org.apache.poi.hssf.record.formula.eval.ValueEvalsingleOperandEvaluate(Eval eval, int srcRow, short srcCol)
Returns an instanceof StringValueEval or ErrorEval or BlankEval

param
eval
param
srcRow
param
srcCol
return

        ValueEval retval;
        if (eval instanceof AreaEval) {
            AreaEval ae = (AreaEval) eval;
            if (ae.contains(srcRow, srcCol)) { // circular ref!
                retval = ErrorEval.CIRCULAR_REF_ERROR;
            }
            else if (ae.isRow()) {
                if (ae.containsColumn(srcCol)) {
                    ValueEval ve = ae.getValueAt(ae.getFirstRow(), srcCol);
                    retval = internalResolveEval(eval);
                }
                else {
                    retval = ErrorEval.NAME_INVALID;
                }
            }
            else if (ae.isColumn()) {
                if (ae.containsRow(srcRow)) {
                    ValueEval ve = ae.getValueAt(srcRow, ae.getFirstColumn());
                    retval = internalResolveEval(eval);
                }
                else {
                    retval = ErrorEval.NAME_INVALID;
                }
            }
            else {
                retval = ErrorEval.NAME_INVALID;
            }
        }
        else {
            retval = internalResolveEval(eval);
        }
        return retval;