Examples of AreaEval


Examples of org.apache.poi.hssf.record.formula.eval.AreaEval

   
   
    protected ValueEval singleOperandEvaluate(Eval eval, int srcRow, short srcCol) {
        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 = attemptXlateToText(ve);
                }
                else {
                    retval = ErrorEval.VALUE_INVALID;
                }
            }
            else if (ae.isColumn()) {
                if (ae.containsRow(srcRow)) {
                    ValueEval ve = ae.getValueAt(srcRow, ae.getFirstColumn());
                    retval = attemptXlateToText(ve);
                }
                else {
                    retval = ErrorEval.VALUE_INVALID;
                }
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.eval.AreaEval

         * dealing with errorevals later.
         */
        outer:
        for (int i=0, iSize=operands.length; i<iSize; i++) {
            if (operands[i] instanceof AreaEval) {
                AreaEval ae = (AreaEval) operands[i];
                ValueEval[] values = ae.getValues();
                for (int j=0, jSize=values.length; j<jSize; j++) {
                    ValueEval tempVe = singleOperandEvaluate(values[j], srcRow, srcCol, true);
                    if (tempVe instanceof BoolEval) {
                        b = b || ((BoolEval) tempVe).getBooleanValue();
                        atleastOneNonBlank = true;
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.eval.AreaEval

        outer: do {
            if (operands.length == 2) {
                Eval[] xEvals = new Eval[1];
                Eval[] yEvals = new Eval[1];
                if (operands[X] instanceof AreaEval) {
                    AreaEval ae = (AreaEval) operands[0];
                    xEvals = ae.getValues();
                }
                else if (operands[X] instanceof ErrorEval) {
                    break outer;
                }
                else {
                    xEvals[0] = operands[X];
                }
               
                if (operands[Y] instanceof AreaEval) {
                    AreaEval ae = (AreaEval) operands[Y];
                    yEvals = ae.getValues();
                }
                else if (operands[Y] instanceof ErrorEval) {
                    break outer;
                }
                else {
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.eval.AreaEval

         * dealing with errorevals later.
         */
        outer:
        for (int i=0, iSize=operands.length; i<iSize; i++) {
            if (operands[i] instanceof AreaEval) {
                AreaEval ae = (AreaEval) operands[i];
                ValueEval[] values = ae.getValues();
                for (int j=0, jSize=values.length; j<jSize; j++) {
                    ValueEval tempVe = singleOperandEvaluate(values[j], srcRow, srcCol, true);
                    if (tempVe instanceof BoolEval) {
                        b = b && ((BoolEval) tempVe).getBooleanValue();
                        atleastOneNonBlank = true;
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.eval.AreaEval

    protected double[] getNumberArray(Eval operand, int srcRow, short srcCol) {
        double[] retval;
        int count = 0;
       
        if (operand instanceof AreaEval) {
            AreaEval ae = (AreaEval) operand;
            ValueEval[] values = ae.getValues();
            retval = new double[values.length];
            for (int j=0, jSize=values.length; j<jSize; j++) {
                /*
                 * TODO: For an AreaEval, we are constructing a RefEval
                 * per element.
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.eval.AreaEval

        switch (evals.length) {
        default:
            retval = ErrorEval.VALUE_INVALID;
        case 1:
            if (evals[0] instanceof AreaEval) {
                AreaEval ae = (AreaEval) evals[0];
                rnum = ae.getFirstRow();
            }
            else if (evals[0] instanceof RefEval) {
                RefEval re = (RefEval) evals[0];
                rnum = re.getRow();
            }
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.eval.AreaEval

        switch (evals.length) {
        default:
            retval = ErrorEval.VALUE_INVALID;
        case 1:
            if (evals[0] instanceof AreaEval) {
                AreaEval ae = (AreaEval) evals[0];
                cnum = ae.getFirstColumn();
            }
            else if (evals[0] instanceof RefEval) {
                RefEval re = (RefEval) evals[0];
                cnum = re.getColumn();
            }
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.eval.AreaEval

    protected static final String EMPTY_STRING = "";
   
    protected ValueEval singleOperandEvaluate(Eval eval, int srcRow, short srcCol) {
        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 = attemptXlateToText(ve);
                }
                else {
                    retval = ErrorEval.VALUE_INVALID;
                }
            }
            else if (ae.isColumn()) {
                if (ae.containsRow(srcRow)) {
                    ValueEval ve = ae.getValueAt(srcRow, ae.getFirstColumn());
                    retval = attemptXlateToText(ve);
                }
                else {
                    retval = ErrorEval.VALUE_INVALID;
                }
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.eval.AreaEval

                    for (short y = col0; row != null && y < col1 + 1; y++) {
                        values[(x - row0) * (col1 - col0 + 1) + (y - col0)] =
                            getEvalForCell(row.getCell(y), row, sheet, workbook);
                    }
                }
                AreaEval ae = new Area2DEval(ap, values);
                stack.push(ae);
            }
            else if (ptgs[i] instanceof Area3DPtg) {
                Area3DPtg a3dp = (Area3DPtg) ptgs[i];
                short row0 = a3dp.getFirstRow();
                short col0 = a3dp.getFirstColumn();
                short row1 = a3dp.getLastRow();
                short col1 = a3dp.getLastColumn();
                HSSFSheet xsheet = workbook.getSheetAt(a3dp.getExternSheetIndex());
                ValueEval[] values = new ValueEval[(row1 - row0 + 1) * (col1 - col0 + 1)];
                for (short x = row0; sheet != null && x < row1 + 1; x++) {
                    HSSFRow row = sheet.getRow(x);
                    for (short y = col0; row != null && y < col1 + 1; y++) {
                        values[(x - row0) * (col1 - col0 + 1) + (y - col0)] =
                            getEvalForCell(row.getCell(y), row, xsheet, workbook);
                    }
                }
                AreaEval ae = new Area3DEval(a3dp, values);
                stack.push(ae);
            }
            else {
                Eval ptgEval = getEvalForPtg(ptgs[i]);
                stack.push(ptgEval);
            }
        }
        ValueEval value = ((ValueEval) stack.pop());
        if (value instanceof RefEval) {
            RefEval rv = (RefEval) value;
            value = rv.getInnerValueEval();
        }
        else if (value instanceof AreaEval) {
            AreaEval ae = (AreaEval) value;
            if (ae.isRow())
                value = ae.getValueAt(ae.getFirstRow(), srcColNum);
            else if (ae.isColumn())
                value = ae.getValueAt(srcRowNum, ae.getFirstColumn());
            else
                value = ErrorEval.VALUE_INVALID;
        }
        return value;
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.eval.AreaEval

   
   
    protected ValueEval singleOperandEvaluate(Eval eval, int srcRow, short srcCol) {
        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 = attemptXlateToText(ve);
                }
                else {
                    retval = ErrorEval.VALUE_INVALID;
                }
            }
            else if (ae.isColumn()) {
                if (ae.containsRow(srcRow)) {
                    ValueEval ve = ae.getValueAt(srcRow, ae.getFirstColumn());
                    retval = attemptXlateToText(ve);
                }
                else {
                    retval = ErrorEval.VALUE_INVALID;
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.