本站不再更新,歡迎光臨 java開發(fā)技術(shù)網(wǎng)
          隨筆-230  評論-230  文章-8  trackbacks-0

          /**
          ? * 獲取cell中的數(shù)據(jù)
          ? * @param cell
          ? * @return
          ? */
          ?private String readCell(HSSFCell cell) {
          ??if (null == cell) {
          ???return "";
          ??}
          ??SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA);
          ??switch (cell.getCellType()) {
          ???case HSSFCell.CELL_TYPE_STRING: {
          ????return Strings.trim(cell.getStringCellValue());
          ???}
          ???case HSSFCell.CELL_TYPE_NUMERIC: {
          ????if(HSSFDateUtil.isCellDateFormatted(cell)){
          ?????
          ?????return sdf.format(cell.getDateCellValue());
          ????}else{
          ?????return Strings.trim(new BigDecimal(cell.getNumericCellValue())
          ???????.toString());
          ????}

          ???}
          ???case HSSFCell.CELL_TYPE_BOOLEAN: {
          ????return Strings.trim(String.valueOf(cell.getBooleanCellValue()));
          ???}
          ???case HSSFCell.CELL_TYPE_FORMULA: {
          ????return Strings.trim(String.valueOf(cell.getCellFormula()));
          ???}
          ???
          ???default: {
          ????return Strings.trim(cell.getStringCellValue());
          ???}
          ??}
          ?}

          posted on 2006-12-21 16:10 有貓相伴的日子 閱讀(1065) 評論(0)  編輯  收藏 所屬分類: jdk
          本站不再更新,歡迎光臨 java開發(fā)技術(shù)網(wǎng)
          主站蜘蛛池模板: 阿图什市| 阜城县| 忻城县| 共和县| 丘北县| 英吉沙县| 临武县| 江安县| 抚松县| 怀远县| 万载县| 大足县| 邵阳市| 邵武市| 雅江县| 云和县| 三门峡市| 双柏县| 汝城县| 安徽省| 沧源| 莎车县| 富宁县| 常山县| 平安县| 原阳县| 清远市| 无锡市| 岐山县| 虹口区| 巫溪县| 上虞市| 汉源县| 客服| 郁南县| 林周县| 尼勒克县| 兴宁市| 福贡县| 长白| 太白县|