예제 #1
0
파일: ExcelOper.java 프로젝트: glaftr/GLAF
 /**
  * 取得一列的cell
  *
  * @param rowNum 行号
  * @return 一列的cell
  */
 public Cell[] getColCells(int colNum) {
   if (readOnlyWBook == true) {
     return currentSheet.getColumn(colNum);
   } else {
     return wrCurrentSheet.getColumn(colNum);
   }
 }
예제 #2
0
 public static int nextFreeColNumber(WritableSheet sheet) {
   if (sheet == null) return 0;
   int colCount = sheet.getColumns();
   Cell[] cells;
   int i = 0;
   for (; i < colCount; i++) {
     cells = sheet.getColumn(i);
     for (Cell cell : cells) {
       if (cell.getContents() == null || cell.getContents().isEmpty()) return i;
     }
   }
   return i;
 }