Package org.apache.poi.hssf.record.formula.eval

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


    protected static void pushRef3DEval(Ref3DPtg ptg, Stack stack, HSSFCell cell,
            HSSFRow row, HSSFSheet sheet, HSSFWorkbook workbook) {
        if (cell != null)
            switch (cell.getCellType()) {
            case HSSFCell.CELL_TYPE_NUMERIC:
                stack.push(new Ref3DEval(ptg, new NumberEval(cell.getNumericCellValue()), false));
                break;
            case HSSFCell.CELL_TYPE_STRING:
                stack.push(new Ref3DEval(ptg, new StringEval(cell.getRichStringCellValue().getString()), false));
                break;
            case HSSFCell.CELL_TYPE_FORMULA:
                stack.push(new Ref3DEval(ptg, internalEvaluate(cell, row, sheet, workbook), true));
                break;
            case HSSFCell.CELL_TYPE_BOOLEAN:
                stack.push(new Ref3DEval(ptg, cell.getBooleanCellValue() ? BoolEval.TRUE : BoolEval.FALSE, false));
                break;
            case HSSFCell.CELL_TYPE_BLANK:
                stack.push(new Ref3DEval(ptg, BlankEval.INSTANCE, false));
                break;
            case HSSFCell.CELL_TYPE_ERROR:
                stack.push(new Ref3DEval(ptg, ErrorEval.UNKNOWN_ERROR, false)); // TODO: think abt this
                break;
            }
        else {
            stack.push(new Ref3DEval(ptg, BlankEval.INSTANCE, false));
        }
    }
View Full Code Here


     * create a Ref3DEval for Ref3DPtg.
     */
    private static Ref3DEval createRef3DEval(Ref3DPtg ptg, HSSFCell cell,
            HSSFRow row, HSSFSheet sheet, HSSFWorkbook workbook) {
        if (cell == null) {
            return new Ref3DEval(ptg, BlankEval.INSTANCE);
        }
        switch (cell.getCellType()) {
            case HSSFCell.CELL_TYPE_NUMERIC:
                return new Ref3DEval(ptg, new NumberEval(cell.getNumericCellValue()));
            case HSSFCell.CELL_TYPE_STRING:
                return new Ref3DEval(ptg, new StringEval(cell.getRichStringCellValue().getString()));
            case HSSFCell.CELL_TYPE_FORMULA:
                return new Ref3DEval(ptg, internalEvaluate(cell, row, sheet, workbook));
            case HSSFCell.CELL_TYPE_BOOLEAN:
                return new Ref3DEval(ptg, BoolEval.valueOf(cell.getBooleanCellValue()));
            case HSSFCell.CELL_TYPE_BLANK:
                return new Ref3DEval(ptg, BlankEval.INSTANCE);
            case HSSFCell.CELL_TYPE_ERROR:
                return new Ref3DEval(ptg, ErrorEval.valueOf(cell.getErrorCellValue()));
        }
        throw new RuntimeException("Unexpected cell type (" + cell.getCellType() + ")");
    }
View Full Code Here

     * create a Ref3DEval for Ref3DPtg.
     */
    private static Ref3DEval createRef3DEval(Ref3DPtg ptg, HSSFCell cell,
            HSSFRow row, HSSFSheet sheet, HSSFWorkbook workbook) {
        if (cell == null) {
            return new Ref3DEval(ptg, BlankEval.INSTANCE);
        }
        switch (cell.getCellType()) {
            case HSSFCell.CELL_TYPE_NUMERIC:
                return new Ref3DEval(ptg, new NumberEval(cell.getNumericCellValue()));
            case HSSFCell.CELL_TYPE_STRING:
                return new Ref3DEval(ptg, new StringEval(cell.getRichStringCellValue().getString()));
            case HSSFCell.CELL_TYPE_FORMULA:
                return new Ref3DEval(ptg, internalEvaluate(cell, row, sheet, workbook));
            case HSSFCell.CELL_TYPE_BOOLEAN:
                return new Ref3DEval(ptg, BoolEval.valueOf(cell.getBooleanCellValue()));
            case HSSFCell.CELL_TYPE_BLANK:
                return new Ref3DEval(ptg, BlankEval.INSTANCE);
            case HSSFCell.CELL_TYPE_ERROR:
                return new Ref3DEval(ptg, ErrorEval.valueOf(cell.getErrorCellValue()));
        }
        throw new RuntimeException("Unexpected cell type (" + cell.getCellType() + ")");
    }
View Full Code Here

      _firstRowIndex = re.getRow();
      _firstColumnIndex = re.getColumn();
      _height = 1;
      _width = 1;
      if (re instanceof Ref3DEval) {
        Ref3DEval r3e = (Ref3DEval) re;
        _externalSheetIndex = r3e.getExternSheetIndex();
      } else {
        _externalSheetIndex = INVALID_SHEET_INDEX;
      }
    }
View Full Code Here

    protected static void pushRef3DEval(Ref3DPtg ptg, Stack stack, HSSFCell cell,
            HSSFRow row, HSSFSheet sheet, HSSFWorkbook workbook) {
        if (cell != null)
            switch (cell.getCellType()) {
            case HSSFCell.CELL_TYPE_NUMERIC:
                stack.push(new Ref3DEval(ptg, new NumberEval(cell.getNumericCellValue()), false));
                break;
            case HSSFCell.CELL_TYPE_STRING:
                stack.push(new Ref3DEval(ptg, new StringEval(cell.getRichStringCellValue().getString()), false));
                break;
            case HSSFCell.CELL_TYPE_FORMULA:
                stack.push(new Ref3DEval(ptg, internalEvaluate(cell, row, sheet, workbook), true));
                break;
            case HSSFCell.CELL_TYPE_BOOLEAN:
                stack.push(new Ref3DEval(ptg, cell.getBooleanCellValue() ? BoolEval.TRUE : BoolEval.FALSE, false));
                break;
            case HSSFCell.CELL_TYPE_BLANK:
                stack.push(new Ref3DEval(ptg, BlankEval.INSTANCE, false));
                break;
            case HSSFCell.CELL_TYPE_ERROR:
                stack.push(new Ref3DEval(ptg, ErrorEval.UNKNOWN_ERROR, false)); // TODO: think abt this
                break;
            }
        else {
            stack.push(new Ref3DEval(ptg, BlankEval.INSTANCE, false));
        }
    }
View Full Code Here

     * create a Ref3DEval for Ref3DPtg.
     */
    private static Ref3DEval createRef3DEval(Ref3DPtg ptg, HSSFCell cell,
            HSSFRow row, HSSFSheet sheet, HSSFWorkbook workbook) {
        if (cell == null) {
            return new Ref3DEval(ptg, BlankEval.INSTANCE);
        }
        switch (cell.getCellType()) {
            case HSSFCell.CELL_TYPE_NUMERIC:
                return new Ref3DEval(ptg, new NumberEval(cell.getNumericCellValue()));
            case HSSFCell.CELL_TYPE_STRING:
                return new Ref3DEval(ptg, new StringEval(cell.getRichStringCellValue().getString()));
            case HSSFCell.CELL_TYPE_FORMULA:
                return new Ref3DEval(ptg, internalEvaluate(cell, row, sheet, workbook));
            case HSSFCell.CELL_TYPE_BOOLEAN:
                return new Ref3DEval(ptg, BoolEval.valueOf(cell.getBooleanCellValue()));
            case HSSFCell.CELL_TYPE_BLANK:
                return new Ref3DEval(ptg, BlankEval.INSTANCE);
            case HSSFCell.CELL_TYPE_ERROR:
                return new Ref3DEval(ptg, ErrorEval.valueOf(cell.getErrorCellValue()));
        }
        throw new RuntimeException("Unexpected cell type (" + cell.getCellType() + ")");
    }
View Full Code Here

    protected static void pushRef3DEval(Ref3DPtg ptg, Stack stack, HSSFCell cell,
            HSSFRow row, HSSFSheet sheet, HSSFWorkbook workbook) {
        if (cell != null)
            switch (cell.getCellType()) {
            case HSSFCell.CELL_TYPE_NUMERIC:
                stack.push(new Ref3DEval(ptg, new NumberEval(cell.getNumericCellValue()), false));
                break;
            case HSSFCell.CELL_TYPE_STRING:
                stack.push(new Ref3DEval(ptg, new StringEval(cell.getRichStringCellValue().getString()), false));
                break;
            case HSSFCell.CELL_TYPE_FORMULA:
                stack.push(new Ref3DEval(ptg, internalEvaluate(cell, row, sheet, workbook), true));
                break;
            case HSSFCell.CELL_TYPE_BOOLEAN:
                stack.push(new Ref3DEval(ptg, cell.getBooleanCellValue() ? BoolEval.TRUE : BoolEval.FALSE, false));
                break;
            case HSSFCell.CELL_TYPE_BLANK:
                stack.push(new Ref3DEval(ptg, BlankEval.INSTANCE, false));
                break;
            case HSSFCell.CELL_TYPE_ERROR:
                stack.push(new Ref3DEval(ptg, ErrorEval.UNKNOWN_ERROR, false)); // TODO: think abt this
                break;
            }
        else {
            stack.push(new Ref3DEval(ptg, BlankEval.INSTANCE, false));
        }
    }
View Full Code Here

      _firstRowIndex = re.getRow();
      _firstColumnIndex = re.getColumn();
      _height = 1;
      _width = 1;
      if (re instanceof Ref3DEval) {
        Ref3DEval r3e = (Ref3DEval) re;
        _externalSheetIndex = r3e.getExternSheetIndex();
      } else {
        _externalSheetIndex = INVALID_SHEET_INDEX;
      }
    }
View Full Code Here

     * create a Ref3DEval for Ref3DPtg.
     */
    private static Ref3DEval createRef3DEval(Ref3DPtg ptg, Cell cell,
            Row row, Sheet sheet, Workbook workbook) {
        if (cell == null) {
            return new Ref3DEval(ptg, BlankEval.INSTANCE);
        }
        switch (cell.getCellType()) {
            case Cell.CELL_TYPE_NUMERIC:
                return new Ref3DEval(ptg, new NumberEval(cell.getNumericCellValue()));
            case Cell.CELL_TYPE_STRING:
                return new Ref3DEval(ptg, new StringEval(cell.getRichStringCellValue().getString()));
            case Cell.CELL_TYPE_FORMULA:
                return new Ref3DEval(ptg, internalEvaluate(cell, row, sheet, workbook));
            case Cell.CELL_TYPE_BOOLEAN:
                return new Ref3DEval(ptg, BoolEval.valueOf(cell.getBooleanCellValue()));
            case Cell.CELL_TYPE_BLANK:
                return new Ref3DEval(ptg, BlankEval.INSTANCE);
            case Cell.CELL_TYPE_ERROR:
                return new Ref3DEval(ptg, ErrorEval.valueOf(cell.getErrorCellValue()));
        }
        throw new RuntimeException("Unexpected cell type (" + cell.getCellType() + ")");
    }
View Full Code Here

    protected static void pushRef3DEval(Ref3DPtg ptg, Stack stack, HSSFCell cell,
            HSSFRow row, HSSFSheet sheet, HSSFWorkbook workbook) {
        if (cell != null)
            switch (cell.getCellType()) {
            case HSSFCell.CELL_TYPE_NUMERIC:
                stack.push(new Ref3DEval(ptg, new NumberEval(cell.getNumericCellValue()), false));
                break;
            case HSSFCell.CELL_TYPE_STRING:
                stack.push(new Ref3DEval(ptg, new StringEval(cell.getStringCellValue()), false));
                break;
            case HSSFCell.CELL_TYPE_FORMULA:
                stack.push(new Ref3DEval(ptg, internalEvaluate(cell, row, sheet, workbook), true));
                break;
            case HSSFCell.CELL_TYPE_BOOLEAN:
                stack.push(new Ref3DEval(ptg, cell.getBooleanCellValue() ? BoolEval.TRUE : BoolEval.FALSE, false));
                break;
            case HSSFCell.CELL_TYPE_BLANK:
                stack.push(new Ref3DEval(ptg, BlankEval.INSTANCE, false));
                break;
            case HSSFCell.CELL_TYPE_ERROR:
                stack.push(new Ref3DEval(ptg, ErrorEval.UNKNOWN_ERROR, false)); // TODO: think abt this
                break;
            }
        else {
            stack.push(new Ref3DEval(ptg, BlankEval.INSTANCE, false));
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.record.formula.eval.Ref3DEval

Copyright © 2018 www.massapicom. 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.