码迷,mamicode.com
首页 > 其他好文 > 详细

关于Cell中的各种值的类型判断

时间:2018-08-13 12:18:04      阅读:935      评论:0      收藏:0      [点我收藏+]

标签:getc   str   form   pre   erro   value   orm   error   boolean   

switch (cell.getCellType()){
case Cell.CELL_TYPE_NUMERIC: //数字
cellValue = stringDateProcess(cell);
break;
case Cell.CELL_TYPE_STRING: //字符串
cellValue = String.valueOf(cell.getStringCellValue());
break;
case Cell.CELL_TYPE_BOOLEAN: //Boolean
cellValue = String.valueOf(cell.getBooleanCellValue());
break;
case Cell.CELL_TYPE_FORMULA: //公式
cellValue = String.valueOf(cell.getCellFormula());
break;
case Cell.CELL_TYPE_BLANK: //空值
cellValue = "";
break;
case Cell.CELL_TYPE_ERROR: //故障
cellValue = "非法字符";
break;
default:
cellValue = "未知类型";
break;
}

关于Cell中的各种值的类型判断

标签:getc   str   form   pre   erro   value   orm   error   boolean   

原文地址:https://www.cnblogs.com/lijianli/p/9466833.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!