Example usage for org.apache.poi.hssf.usermodel HSSFCell getCachedFormulaResultTypeEnum

List of usage examples for org.apache.poi.hssf.usermodel HSSFCell getCachedFormulaResultTypeEnum

Introduction

In this page you can find the example usage for org.apache.poi.hssf.usermodel HSSFCell getCachedFormulaResultTypeEnum.

Prototype

@Deprecated
@Removal(version = "4.2")
@Override
public CellType getCachedFormulaResultTypeEnum() 

Source Link

Document

Only valid for formula cells

Usage

From source file:de.viaboxx.nlstools.formats.MBExcelPersistencer.java

License:Apache License

private Object getValue(HSSFCell cell, CellType cellType) {
    switch (cellType) {
    case NUMERIC:
        if (HSSFDateUtil.isCellDateFormatted(cell)) {
            return cell.getDateCellValue();
        } else {/*from w  ww  .jav  a2s . co m*/
            return cell.getNumericCellValue();
        }
    case FORMULA:
        return getValue(cell, cell.getCachedFormulaResultTypeEnum());
    case BOOLEAN:
        return cell.getBooleanCellValue();
    case STRING:
        return cell.getStringCellValue();
    case ERROR:
        return cell.getErrorCellValue();
    default:
        return null;
    // do not handle Formular, Error, Blank, ...
    }
}