]> source.dussan.org Git - poi.git/commitdiff
bug 59791: getCellType and getCachedFormulaResultType should return an integer for...
authorJaven O'Neal <onealj@apache.org>
Mon, 4 Jul 2016 11:54:20 +0000 (11:54 +0000)
committerJaven O'Neal <onealj@apache.org>
Mon, 4 Jul 2016 11:54:20 +0000 (11:54 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1751256 13f79535-47bb-0310-9956-ffa450edef68

76 files changed:
src/examples/src/org/apache/poi/hssf/usermodel/examples/HSSFReadWrite.java
src/examples/src/org/apache/poi/hssf/view/SVSheetTable.java
src/examples/src/org/apache/poi/hssf/view/SVTableCellEditor.java
src/examples/src/org/apache/poi/hssf/view/SVTableCellRenderer.java
src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java
src/examples/src/org/apache/poi/ss/examples/ToCSV.java
src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java
src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java
src/java/org/apache/poi/hssf/usermodel/HSSFCell.java
src/java/org/apache/poi/hssf/usermodel/HSSFEvaluationCell.java
src/java/org/apache/poi/hssf/usermodel/HSSFFormulaEvaluator.java
src/java/org/apache/poi/hssf/usermodel/HSSFOptimiser.java
src/java/org/apache/poi/hssf/usermodel/HSSFRow.java
src/java/org/apache/poi/ss/format/CellFormat.java
src/java/org/apache/poi/ss/formula/EvaluationCache.java
src/java/org/apache/poi/ss/formula/EvaluationCell.java
src/java/org/apache/poi/ss/formula/SheetRefEvaluator.java
src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java
src/java/org/apache/poi/ss/formula/eval/forked/ForkedEvaluationCell.java
src/java/org/apache/poi/ss/formula/eval/forked/ForkedEvaluator.java
src/java/org/apache/poi/ss/usermodel/Cell.java
src/java/org/apache/poi/ss/usermodel/DataFormatter.java
src/java/org/apache/poi/ss/util/SheetUtil.java
src/java/org/apache/poi/ss/util/cellwalk/CellWalk.java
src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExcelExtractor.java
src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExportToXml.java
src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFCell.java
src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFEvaluationCell.java
src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFFormulaEvaluator.java
src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFRow.java
src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java
src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java
src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java
src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationCell.java
src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java
src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFFormulaUtils.java
src/ooxml/testcases/org/apache/poi/xssf/model/TestCalculationChain.java
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestFormulaEvaluatorOnXSSF.java
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestMultiSheetFormulaEvaluatorOnXSSF.java
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCell.java
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaParser.java
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFPivotTable.java
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFRow.java
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java
src/scratchpad/src/org/apache/poi/hssf/converter/AbstractExcelConverter.java
src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java
src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java
src/testcases/org/apache/poi/hssf/model/TestRVA.java
src/testcases/org/apache/poi/hssf/usermodel/TestBug42464.java
src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java
src/testcases/org/apache/poi/hssf/usermodel/TestExternalReferenceChange.java
src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorBugs.java
src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorDocs.java
src/testcases/org/apache/poi/hssf/usermodel/TestHSSFCell.java
src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDataFormatter.java
src/testcases/org/apache/poi/hssf/usermodel/TestHSSFFormulaEvaluator.java
src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java
src/testcases/org/apache/poi/ss/formula/TestMissingWorkbook.java
src/testcases/org/apache/poi/ss/formula/TestWorkbookEvaluator.java
src/testcases/org/apache/poi/ss/formula/atp/TestRandBetween.java
src/testcases/org/apache/poi/ss/formula/atp/TestYearFracCalculatorFromSpreadsheet.java
src/testcases/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java
src/testcases/org/apache/poi/ss/formula/eval/TestMultiSheetEval.java
src/testcases/org/apache/poi/ss/formula/functions/BaseTestFunctionsFromSpreadsheet.java
src/testcases/org/apache/poi/ss/formula/functions/TestCountFuncs.java
src/testcases/org/apache/poi/ss/formula/functions/TestNper.java
src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java
src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java
src/testcases/org/apache/poi/ss/usermodel/BaseTestRow.java
src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetAutosizeColumn.java
src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetUpdateArrayFormulas.java
src/testcases/org/apache/poi/ss/util/TestSheetBuilder.java

index 6470fe923bcbfb5b5f52b0502d45873613b8f602..2f67f7f0e50ce6d596b0d726610ce3f63ac5f28a 100644 (file)
@@ -185,7 +185,7 @@ public final class HSSFReadWrite {
                                                        HSSFCell cell = row.getCell(c);
                                                        String value = null;
 
-                                                       switch (cell.getCellType()) {
+                                                       switch (cell.getCellTypeEnum()) {
 
                                                                case FORMULA:
                                                                        value = "FORMULA value=" + cell.getCellFormula();
index b33d8cba10e98120c664b5b31d67f05c201e33b7..8f95e03fbe3f06922718055902d165855f4ec359 100644 (file)
@@ -142,7 +142,7 @@ public class SVSheetTable extends JTable {
       HSSFCell cell = (HSSFCell) getValueAt(row, col);
       String formula = "";
       if (cell != null) {
-        if (cell.getCellType() == CellType.FORMULA) {
+        if (cell.getCellTypeEnum() == CellType.FORMULA) {
           formula = cell.getCellFormula();
         } else {
           formula = cell.toString();
index c4a2d1dd0873c516ee97c234d3849ebbb53d6dd2..56d3e58a7d81b33c72f1cc7433664d731107e47f 100644 (file)
@@ -151,7 +151,7 @@ public class SVTableCellEditor extends AbstractCellEditor implements TableCellEd
 
 
       //Set the value that is rendered for the cell
-      switch (cell.getCellType()) {
+      switch (cell.getCellTypeEnum()) {
         case BLANK:
           editor.setText("");
           break;
index e77a18196c57768d55eeeecfdf388ba696cbb6d3..6f05b097833fafe13e847721bc35595a597fecf2 100644 (file)
@@ -165,7 +165,7 @@ public class SVTableCellRenderer extends JLabel
             isBorderSet=true;
 
             //Set the value that is rendered for the cell
-            switch (c.getCellType()) {
+            switch (c.getCellTypeEnum()) {
               case BLANK:
                 setValue("");
               break;
index 0a35eaa116ca4de9eb5cb6e094c1e94dd2b9db3f..dce4b0196e1157ed2ea006b9add24b5f29559837 100644 (file)
@@ -179,7 +179,7 @@ public class ExcelComparator {
 \r
     private void compareDataInCell(Locator loc1, Locator loc2) {\r
         if (isCellTypeMatches(loc1, loc2)) {\r
-            final CellType loc1cellType = loc1.cell.getCellType();\r
+            final CellType loc1cellType = loc1.cell.getCellTypeEnum();\r
             switch(loc1cellType) {\r
                 case BLANK:\r
                 case STRING:\r
@@ -581,8 +581,8 @@ public class ExcelComparator {
      * Checks if cell type matches.\r
      */\r
     private boolean isCellTypeMatches(Locator loc1, Locator loc2) {\r
-        CellType type1 = loc1.cell.getCellType();\r
-        CellType type2 = loc2.cell.getCellType();\r
+        CellType type1 = loc1.cell.getCellTypeEnum();\r
+        CellType type2 = loc2.cell.getCellTypeEnum();\r
         if (type1 == type2) return true;\r
         addMessage(loc1, loc2,\r
             "Cell Data-Type does not Match in :: ",\r
index 616f838706e0799831055558d1ee3ded7667bba4..e8bca901f8d944af904a81878f553cb86a707b49 100644 (file)
@@ -542,7 +542,7 @@ public class ToCSV {
                     csvLine.add("");
                 }
                 else {
-                    if(cell.getCellType() != CellType.FORMULA) {
+                    if(cell.getCellTypeEnum() != CellType.FORMULA) {
                         csvLine.add(this.formatter.formatCellValue(cell));
                     }
                     else {
index 3f2ef7ea09f596b740cdb4903eb265aa307c7b17..59cf4180f1bdfed456265646c7c0f86d9ab83682 100644 (file)
@@ -336,9 +336,9 @@ public class ToHtml {
     }
 
     private static CellType ultimateCellType(Cell c) {
-        CellType type = c.getCellType();
+        CellType type = c.getCellTypeEnum();
         if (type == CellType.FORMULA)
-            type = c.getCachedFormulaResultType();
+            type = c.getCachedFormulaResultTypeEnum();
         return type;
     }
 
index 09ecb8322daf1a9ccb27d5553457041df75ddf99..c4eb047312c1d1cee7fa6605f01151867fdce093 100644 (file)
@@ -321,7 +321,7 @@ public class ExcelExtractor extends POIOLE2TextExtractor implements org.apache.p
                                                // Only output if requested
                                                outputContents = _includeBlankCells;
                                        } else {
-                                               switch(cell.getCellType()) {
+                                               switch(cell.getCellTypeEnum()) {
                                                        case STRING:
                                                                text.append(cell.getRichStringCellValue().getString());
                                                                break;
@@ -338,7 +338,7 @@ public class ExcelExtractor extends POIOLE2TextExtractor implements org.apache.p
                                                                if(!_shouldEvaluateFormulas) {
                                                                        text.append(cell.getCellFormula());
                                                                } else {
-                                                                       switch(cell.getCachedFormulaResultType()) {
+                                                                       switch(cell.getCachedFormulaResultTypeEnum()) {
                                                                                case STRING:
                                                                                        HSSFRichTextString str = cell.getRichStringCellValue();
                                                                                        if(str != null && str.length() > 0) {
@@ -359,13 +359,13 @@ public class ExcelExtractor extends POIOLE2TextExtractor implements org.apache.p
                                                                                        text.append(ErrorEval.getText(cell.getErrorCellValue()));
                                                                                        break;
                                                                                default:
-                                                                                       throw new IllegalStateException("Unexpected cell cached formula result type: " + cell.getCachedFormulaResultType());
+                                                                                       throw new IllegalStateException("Unexpected cell cached formula result type: " + cell.getCachedFormulaResultTypeEnum());
 
                                                                        }
                                                                }
                                                                break;
                                                        default:
-                                                               throw new RuntimeException("Unexpected cell type (" + cell.getCellType() + ")");
+                                                               throw new RuntimeException("Unexpected cell type (" + cell.getCellTypeEnum() + ")");
                                                }
 
                                                // Output the comment, if requested and exists
index 003a93ae1c5264893498adbcc6cb03807e9b61b0..314612fa6895ff777d3992bdb6b1de373d61452d 100644 (file)
@@ -53,6 +53,7 @@ import org.apache.poi.ss.util.CellAddress;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.ss.util.CellReference;
 import org.apache.poi.ss.util.NumberToTextConverter;
+import org.apache.poi.util.Internal;
 import org.apache.poi.util.LocaleUtil;
 
 /**
@@ -442,9 +443,23 @@ public class HSSFCell implements Cell {
 
     /**
      * get the cells type (numeric, formula or string)
+     * 
+     * Will return {@link CellType} in a future version of POI.
+     * For forwards compatibility, do not hard-code cell type literals in your code.
+     */
+    @Override
+    public int getCellType()
+    {
+        return getCellTypeEnum().getCode();
+    }
+    
+    /**
+     * get the cells type (numeric, formula or string)
+     * @deprecated POI 3.15 beta 3
      */
+    @Internal
     @Override
-    public CellType getCellType()
+    public CellType getCellTypeEnum()
     {
         return _cellType;
     }
@@ -995,7 +1010,7 @@ public class HSSFCell implements Cell {
      * Errors are displayed as #ERR&lt;errIdx&gt;
      */
     public String toString() {
-        switch (getCellType()) {
+        switch (getCellTypeEnum()) {
             case BLANK:
                 return "";
             case BOOLEAN:
@@ -1015,7 +1030,7 @@ public class HSSFCell implements Cell {
             case STRING:
                 return getStringCellValue();
             default:
-                return "Unknown Cell Type: " + getCellType();
+                return "Unknown Cell Type: " + getCellTypeEnum();
         }
     }
 
@@ -1128,13 +1143,31 @@ public class HSSFCell implements Cell {
         }
     }
 
+    /**
+     * Only valid for formula cells
+     * 
+     * Will return {@link CellType} in a future version of POI.
+     * For forwards compatibility, do not hard-code cell type literals in your code.
+     * 
+     * @return one of ({@link CellType#NUMERIC}, {@link CellType#STRING},
+     *     {@link CellType#BOOLEAN}, {@link CellType#ERROR}) depending
+     * on the cached value of the formula
+     */
+    @Override
+    public int getCachedFormulaResultType() {
+        return getCachedFormulaResultTypeEnum().getCode();
+    }
+
     /**
      * Only valid for formula cells
      * @return one of ({@link CellType#NUMERIC}, {@link CellType#STRING},
      *     {@link CellType#BOOLEAN}, {@link CellType#ERROR}) depending
      * on the cached value of the formula
+     * @deprecated POI 3.15 beta 3
      */
-    public CellType getCachedFormulaResultType() {
+    @Internal
+    @Override
+    public CellType getCachedFormulaResultTypeEnum() {
         if (_cellType != CellType.FORMULA) {
             throw new IllegalStateException("Only formula cells have cached results");
         }
index dc51b7d9e4dc1c34606371c1fa7c2ee39cc819b6..6cb3f2b6f4425cef660cfe67422cb9c71c78244d 100644 (file)
@@ -20,6 +20,7 @@ package org.apache.poi.hssf.usermodel;
 import org.apache.poi.ss.formula.EvaluationCell;
 import org.apache.poi.ss.formula.EvaluationSheet;
 import org.apache.poi.ss.usermodel.CellType;
+import org.apache.poi.util.Internal;
 /**
  * HSSF wrapper for a cell under evaluation
  */
@@ -49,10 +50,22 @@ final class HSSFEvaluationCell implements EvaluationCell {
        public boolean getBooleanCellValue() {
                return _cell.getBooleanCellValue();
        }
+          /**
+        * Will return {@link CellType} in a future version of POI.
+        * For forwards compatibility, do not hard-code cell type literals in your code.
+        *
+        * @return cell type
+        */
        @Override
-       public CellType getCellType() {
+       public int getCellType() {
                return _cell.getCellType();
        }
+       /** @deprecated POI 3.15 beta 3 */
+       @Internal
+       @Override
+       public CellType getCellTypeEnum() {
+               return _cell.getCellTypeEnum();
+       }
        @Override
        public int getColumnIndex() {
                return _cell.getColumnIndex();
@@ -76,9 +89,21 @@ final class HSSFEvaluationCell implements EvaluationCell {
        @Override
        public String getStringCellValue() {\r
                return _cell.getRichStringCellValue().getString();\r
-       }\r
+       }
+       /**
+        * Will return {@link CellType} in a future version of POI.
+        * For forwards compatibility, do not hard-code cell type literals in your code.
+        *
+        * @return cell type of cached formula result
+        */
+       @Override
+       public int getCachedFormulaResultType() {
+               return _cell.getCachedFormulaResultType();
+       }
+       /** @deprecated POI 3.15 beta 3 */
+       @Internal\r
        @Override
-       public CellType getCachedFormulaResultType() {\r
-               return _cell.getCachedFormulaResultType();\r
+       public CellType getCachedFormulaResultTypeEnum() {\r
+               return _cell.getCachedFormulaResultTypeEnum();\r
        }\r
 }\r
index 6582c3810c3e55b240e91d32009f8e86f35dc156..7aa8f892ba2a9c71f0901215e59654b8d692a385 100644 (file)
@@ -177,7 +177,7 @@ public class HSSFFormulaEvaluator implements FormulaEvaluator, WorkbookEvaluator
                        return null;
                }
 
-               switch (cell.getCellType()) {
+               switch (cell.getCellTypeEnum()) {
                        case BOOLEAN:
                                return CellValue.valueOf(cell.getBooleanCellValue());
                        case ERROR:
@@ -191,7 +191,7 @@ public class HSSFFormulaEvaluator implements FormulaEvaluator, WorkbookEvaluator
                        case BLANK:
                                return null;
                        default:
-                               throw new IllegalStateException("Bad cell type (" + cell.getCellType() + ")");
+                               throw new IllegalStateException("Bad cell type (" + cell.getCellTypeEnum() + ")");
                }
                
        }
@@ -214,7 +214,7 @@ public class HSSFFormulaEvaluator implements FormulaEvaluator, WorkbookEvaluator
         */
        @Override
        public CellType evaluateFormulaCell(Cell cell) {
-               if (cell == null || cell.getCellType() != CellType.FORMULA) {
+               if (cell == null || cell.getCellTypeEnum() != CellType.FORMULA) {
                        return CellType._UNINITIALIZED;
                }
                CellValue cv = evaluateFormulaCellValue(cell);
@@ -244,7 +244,7 @@ public class HSSFFormulaEvaluator implements FormulaEvaluator, WorkbookEvaluator
                        return null;
                }
                HSSFCell result = (HSSFCell) cell;
-               if (cell.getCellType() == CellType.FORMULA) {
+               if (cell.getCellTypeEnum() == CellType.FORMULA) {
                        CellValue cv = evaluateFormulaCellValue(cell);
                        setCellValue(cell, cv);
                        setCellType(cell, cv); // cell will no longer be a formula cell
@@ -330,7 +330,7 @@ public class HSSFFormulaEvaluator implements FormulaEvaluator, WorkbookEvaluator
 
          for(Row r : sheet) {
             for (Cell c : r) {
-               if (c.getCellType() == CellType.FORMULA) {
+               if (c.getCellTypeEnum() == CellType.FORMULA) {
                   evaluator.evaluateFormulaCell(c);
                }
             }
index 347300d5f47805e4e92c68fb1816b89175c55520..d28b7fd7ea47094fbb7dcf4347a55fd0b0991d8e 100644 (file)
@@ -142,7 +142,7 @@ public class HSSFOptimiser {
                        HSSFSheet s = workbook.getSheetAt(sheetNum);
                        for (Row row : s) {
                           for (Cell cell : row) {
-                                       if(cell.getCellType() == CellType.STRING) {
+                                       if(cell.getCellTypeEnum() == CellType.STRING) {
                                                HSSFRichTextString rtr = (HSSFRichTextString)cell.getRichStringCellValue();
                                                UnicodeString u = rtr.getRawUnicodeString();
                                                
index f67de61271b3e61eb4b034df7cf5de0cd54a99db..427779d2f4bc358c851258e00d746712b1f852bb 100644 (file)
@@ -388,7 +388,7 @@ public final class HSSFRow implements Row, Comparable<HSSFRow> {
             case RETURN_NULL_AND_BLANK:
                 return cell;
             case RETURN_BLANK_AS_NULL:
-                boolean isBlank = (cell != null && cell.getCellType() == CellType.BLANK);
+                boolean isBlank = (cell != null && cell.getCellTypeEnum() == CellType.BLANK);
                 return (isBlank) ? null : cell;
             case CREATE_NULL_AS_BLANK:
                 return (cell == null) ? createCell(cellnum, CellType.BLANK) : cell;
index 5775fd3b2ed2542b2db71afe0650d91deec9b704..d284f46e2124414ea4745211a17bd83e9e480e98 100644 (file)
@@ -411,17 +411,17 @@ public class CellFormat {
     /**
      * Returns the ultimate cell type, following the results of formulas.  If
      * the cell is a {@link CellType#FORMULA}, this returns the result of
-     * {@link Cell#getCachedFormulaResultType()}.  Otherwise this returns the
-     * result of {@link Cell#getCellType()}.
+     * {@link Cell#getCachedFormulaResultTypeEnum()}.  Otherwise this returns the
+     * result of {@link Cell#getCellTypeEnum()}.
      *
      * @param cell The cell.
      *
      * @return The ultimate type of this cell.
      */
     public static CellType ultimateType(Cell cell) {
-        CellType type = cell.getCellType();
+        CellType type = cell.getCellTypeEnum();
         if (type == CellType.FORMULA)
-            return cell.getCachedFormulaResultType();
+            return cell.getCachedFormulaResultTypeEnum();
         else
             return type;
     }
index ff655f36bbd27556d2dfcb39c977bff21329af93..cd68db3977e7643751cfe70e7a8f41e74a42086a 100644 (file)
@@ -56,7 +56,7 @@ final class EvaluationCache {
                Loc loc = new Loc(bookIndex, sheetIndex, rowIndex, columnIndex);
                PlainValueCellCacheEntry pcce = _plainCellCache.get(loc);
 
-               if (cell.getCellType() == CellType.FORMULA) {
+               if (cell.getCellTypeEnum() == CellType.FORMULA) {
                        if (fcce == null) {
                                fcce = new FormulaCellCacheEntry();
                                if (pcce == null) {
@@ -197,7 +197,7 @@ final class EvaluationCache {
        }
        public void notifyDeleteCell(int bookIndex, int sheetIndex, EvaluationCell cell) {
 
-               if (cell.getCellType() == CellType.FORMULA) {
+               if (cell.getCellTypeEnum() == CellType.FORMULA) {
                        FormulaCellCacheEntry fcce = _formulaCellCache.remove(cell);
                        if (fcce == null) {
                                // formula cell has not been evaluated yet
index b5a051fec008c372f703990c858e31fe47c5b960..e4378a4df0be819b54015603d154abd76db6ef66 100644 (file)
@@ -30,19 +30,35 @@ import org.apache.poi.ss.usermodel.CellType;
 public interface EvaluationCell {
        /**
         * @return an Object that identifies the underlying cell,
-     * suitable for use as a key in a {@link java.util.HashMap}
+        * suitable for use as a key in a {@link java.util.HashMap}
         */
        Object getIdentityKey();
 
        EvaluationSheet getSheet();
        int getRowIndex();
        int getColumnIndex();
-       CellType getCellType();
+       /**
+        * Will return {@link CellType} in a future version of POI.
+        * For forwards compatibility, do not hard-code cell type literals in your code.
+        *
+        * @return cell type
+        */
+       int getCellType();
+       /** @deprecated POI 3.15 beta 3 */
+       CellType getCellTypeEnum();
 
        double getNumericCellValue();
        String getStringCellValue();\r
        boolean getBooleanCellValue();\r
        int getErrorCellValue();\r
-\r
-       CellType getCachedFormulaResultType();\r
+
+       /**
+        * Will return {@link CellType} in a future version of POI.
+        * For forwards compatibility, do not hard-code cell type literals in your code.
+        *
+        * @return cell type of cached formula result
+        */
+       int getCachedFormulaResultType();
+       /** @deprecated POI 3.15 beta 3 */\r
+       CellType getCachedFormulaResultTypeEnum();\r
 }\r
index c9b408fa51f1d4b5dba9f2bbdf5fe18e08fc309c..cc27e66c48bdb0fa9ea4a17f1714a2cb3e7745a1 100644 (file)
@@ -62,7 +62,7 @@ final class SheetRefEvaluator {
     public boolean isSubTotal(int rowIndex, int columnIndex){
         boolean subtotal = false;
         EvaluationCell cell = getSheet().getCell(rowIndex, columnIndex);
-        if(cell != null && cell.getCellType() == CellType.FORMULA){
+        if(cell != null && cell.getCellTypeEnum() == CellType.FORMULA){
             EvaluationWorkbook wb = _bookEvaluator.getWorkbook();
             for(Ptg ptg : wb.getFormulaTokens(cell)){
                 if(ptg instanceof FuncVarPtg){
index 127fbe520eb0f395937490be5929d7a735ef3320..d1e7d8b226454b71f5b5048c0a03e32fc2ff0dfe 100644 (file)
@@ -276,7 +276,7 @@ public final class WorkbookEvaluator {
         // avoid tracking dependencies to cells that have constant definition
         boolean shouldCellDependencyBeRecorded = _stabilityClassifier == null ? true
                     : !_stabilityClassifier.isCellFinal(sheetIndex, rowIndex, columnIndex);
-        if (srcCell == null || srcCell.getCellType() != CellType.FORMULA) {
+        if (srcCell == null || srcCell.getCellTypeEnum() != CellType.FORMULA) {
             ValueEval result = getValueFromNonFormulaCell(srcCell);
             if (shouldCellDependencyBeRecorded) {
                 tracker.acceptPlainValueDependency(_workbookIx, sheetIndex, rowIndex, columnIndex, result);
@@ -314,7 +314,7 @@ public final class WorkbookEvaluator {
              } catch (RuntimeException re) {
                  if (re.getCause() instanceof WorkbookNotFoundException && _ignoreMissingWorkbooks) {
                      logInfo(re.getCause().getMessage() + " - Continuing with cached value!");
-                     switch(srcCell.getCachedFormulaResultType()) {
+                     switch(srcCell.getCachedFormulaResultTypeEnum()) {
                          case NUMERIC:
                              result = new NumberEval(srcCell.getNumericCellValue());
                              break;
@@ -332,7 +332,7 @@ public final class WorkbookEvaluator {
                             break;
                          case FORMULA:
                         default:
-                            throw new RuntimeException("Unexpected cell type '" + srcCell.getCellType()+"' found!");
+                            throw new RuntimeException("Unexpected cell type '" + srcCell.getCellTypeEnum()+"' found!");
                      }
                  } else {
                      throw re;
@@ -385,7 +385,7 @@ public final class WorkbookEvaluator {
         if (cell == null) {
             return BlankEval.instance;
         }
-        CellType cellType = cell.getCellType();
+        CellType cellType = cell.getCellTypeEnum();
         switch (cellType) {
             case NUMERIC:
                 return new NumberEval(cell.getNumericCellValue());
index efab4912b0a68f95efd4f6ca2b94dfaf0245f8db..8149774142de7d9aab019a3510e7eaf2279d1c3c 100644 (file)
 
 package org.apache.poi.ss.formula.eval.forked;
 
+import org.apache.poi.ss.formula.EvaluationCell;
+import org.apache.poi.ss.formula.EvaluationSheet;
 import org.apache.poi.ss.formula.eval.BlankEval;
 import org.apache.poi.ss.formula.eval.BoolEval;
 import org.apache.poi.ss.formula.eval.ErrorEval;
 import org.apache.poi.ss.formula.eval.NumberEval;
 import org.apache.poi.ss.formula.eval.StringEval;
 import org.apache.poi.ss.formula.eval.ValueEval;
-import org.apache.poi.ss.formula.EvaluationCell;
-import org.apache.poi.ss.formula.EvaluationSheet;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.CellType;
+import org.apache.poi.util.Internal;
 
 /**
  * Represents a cell being used for forked evaluation that has had a value set different from the
@@ -52,6 +53,7 @@ final class ForkedEvaluationCell implements EvaluationCell {
                setValue(BlankEval.instance); // followed by a proper call to setValue()
        }
 
+       @Override
        public Object getIdentityKey() {
                return _masterCell.getIdentityKey();
        }
@@ -101,36 +103,69 @@ final class ForkedEvaluationCell implements EvaluationCell {
                        throw new RuntimeException("Wrong data type (" + _cellType + ")");
                }
        }
-       public CellType getCellType() {
+       /**
+        * Will return {@link CellType} in a future version of POI.
+        * For forwards compatibility, do not hard-code cell type literals in your code.
+        *
+        * @return cell type
+        */
+       @Override
+       public int getCellType() {
+               return _cellType.getCode();
+       }
+       /** @deprecated POI 3.15 beta 3 */
+       @Internal
+       @Override
+       public CellType getCellTypeEnum() {
                return _cellType;
        }
+       @Override
        public boolean getBooleanCellValue() {
                checkCellType(CellType.BOOLEAN);
                return _booleanValue;
        }
+       @Override
        public int getErrorCellValue() {
                checkCellType(CellType.ERROR);
                return _errorValue;
        }
+       @Override
        public double getNumericCellValue() {
                checkCellType(CellType.NUMERIC);
                return _numberValue;
        }
+       @Override
        public String getStringCellValue() {
                checkCellType(CellType.STRING);
                return _stringValue;
        }
+       @Override
        public EvaluationSheet getSheet() {
                return _sheet;
        }
+       @Override
        public int getRowIndex() {
                return _masterCell.getRowIndex();
        }
+       @Override
        public int getColumnIndex() {
                return _masterCell.getColumnIndex();
        }
-    public CellType getCachedFormulaResultType() {
-        return _masterCell.getCachedFormulaResultType();
-    }
+       /**
+        * Will return {@link CellType} in a future version of POI.
+        * For forwards compatibility, do not hard-code cell type literals in your code.
+        *
+        * @return cell type of cached formula result
+        */
+       @Override
+       public int getCachedFormulaResultType() {
+               return _masterCell.getCachedFormulaResultType();
+       }
+       /** @deprecated POI 3.15 beta 3. */
+       @Internal
+       @Override
+       public CellType getCachedFormulaResultTypeEnum() {
+               return _masterCell.getCachedFormulaResultTypeEnum();
+       }
 
 }
index abbf3a3011f4290ccf6f5ec4d4cee26c25f1148b..c8beb37d1d6d27968bd81414ad6206feffa6be81 100644 (file)
@@ -112,7 +112,7 @@ public final class ForkedEvaluator {
        public ValueEval evaluate(String sheetName, int rowIndex, int columnIndex) {
                EvaluationCell cell = _sewb.getEvaluationCell(sheetName, rowIndex, columnIndex);
 
-               switch (cell.getCellType()) {
+               switch (cell.getCellTypeEnum()) {
                        case BOOLEAN:
                                return BoolEval.valueOf(cell.getBooleanCellValue());
                        case ERROR:
@@ -126,7 +126,7 @@ public final class ForkedEvaluator {
                        case BLANK:
                                return null;
                        default:
-                               throw new IllegalStateException("Bad cell type (" + cell.getCellType() + ")");
+                               throw new IllegalStateException("Bad cell type (" + cell.getCellTypeEnum() + ")");
                }
        }
        /**
index 0191b159dd89cd2d42d22ac00d4bb8846f5e8740..c6421b3b471cbbf2c684d0c7f4ea77b153912cae 100644 (file)
@@ -23,6 +23,7 @@ import java.util.Date;
 import org.apache.poi.ss.formula.FormulaParseException;
 import org.apache.poi.ss.util.CellAddress;
 import org.apache.poi.ss.util.CellRangeAddress;
+import org.apache.poi.util.Internal;
 
 /**
  * High level representation of a cell in a row of a spreadsheet.
@@ -153,18 +154,44 @@ public interface Cell {
 
     /**
      * Return the cell type.
+     * 
+     * Will return {@link CellType} in a future version of POI.
+     * For forwards compatibility, do not hard-code cell type literals in your code.
      *
      * @return the cell type
      */
-    CellType getCellType();
+    int getCellType();
+    
+    /**
+     * Return the cell type.
+     *
+     * @return the cell type
+     * @deprecated POI 3.15 beta 3
+     */
+    @Internal
+    CellType getCellTypeEnum();
+    
+    /**
+     * Only valid for formula cells
+     * 
+     * Will return {@link CellType} in a future version of POI.
+     * For forwards compatibility, do not hard-code cell type literals in your code.
+     * 
+     * @return one of ({@link CellType#NUMERIC}, {@link CellType#STRING},
+     *     {@link CellType#BOOLEAN}, {@link CellType#ERROR}) depending
+     * on the cached value of the formula
+     */
+    int getCachedFormulaResultType();
 
     /**
      * Only valid for formula cells
      * @return one of ({@link CellType#NUMERIC}, {@link CellType#STRING},
      *     {@link CellType#BOOLEAN}, {@link CellType#ERROR}) depending
      * on the cached value of the formula
+     * @deprecated POI 3.15 beta 3
      */
-    CellType getCachedFormulaResultType();
+    @Internal
+    CellType getCachedFormulaResultTypeEnum();
 
     /**
      * Set a numeric value for the cell
@@ -248,7 +275,7 @@ public interface Cell {
      * Return a formula for the cell, for example, <code>SUM(C4:E4)</code>
      *
      * @return a formula for the cell
-     * @throws IllegalStateException if the cell type returned by {@link #getCellType()} is not {@link CellType#FORMULA}
+     * @throws IllegalStateException if the cell type returned by {@link #getCellTypeEnum()} is not {@link CellType#FORMULA}
      */
     String getCellFormula();
 
@@ -259,7 +286,7 @@ public interface Cell {
      * For formulas or error cells we return the precalculated value;
      * </p>
      * @return the value of the cell as a number
-     * @throws IllegalStateException if the cell type returned by {@link #getCellType()} is {@link CellType#STRING}
+     * @throws IllegalStateException if the cell type returned by {@link #getCellTypeEnum()} is {@link CellType#STRING}
      * @exception NumberFormatException if the cell value isn't a parsable <code>double</code>.
      * @see DataFormatter for turning this number into a string similar to that which Excel would render this number as.
      */
@@ -271,7 +298,7 @@ public interface Cell {
      * For strings we throw an exception. For blank cells we return a null.
      * </p>
      * @return the value of the cell as a date
-     * @throws IllegalStateException if the cell type returned by {@link #getCellType()} is {@link CellType#STRING}
+     * @throws IllegalStateException if the cell type returned by {@link #getCellTypeEnum()} is {@link CellType#STRING}
      * @exception NumberFormatException if the cell value isn't a parsable <code>double</code>.
      * @see DataFormatter for formatting  this date into a string similar to how excel does.
      */
@@ -323,7 +350,7 @@ public interface Cell {
      * For strings, numbers, and errors, we throw an exception. For blank cells we return a false.
      * </p>
      * @return the value of the cell as a boolean
-     * @throws IllegalStateException if the cell type returned by {@link #getCellType()}
+     * @throws IllegalStateException if the cell type returned by {@link #getCellTypeEnum()}
      *   is not {@link CellType#BOOLEAN}, {@link CellType#BLANK} or {@link CellType#FORMULA}
      */
     boolean getBooleanCellValue();
@@ -336,7 +363,7 @@ public interface Cell {
      * </p>
      *
      * @return the value of the cell as an error code
-     * @throws IllegalStateException if the cell type returned by {@link #getCellType()} isn't {@link CellType#ERROR}
+     * @throws IllegalStateException if the cell type returned by {@link #getCellTypeEnum()} isn't {@link CellType#ERROR}
      * @see FormulaError for error codes
      */
     byte getErrorCellValue();
index 225652f852bc3c72d62d64ad7f93942f8cd5ac19..84f19bfe420b90917cf2d1b851423b39685fdd61 100644 (file)
@@ -879,7 +879,7 @@ public class DataFormatter implements Observer {
             return "";
         }
 
-        CellType cellType = cell.getCellType();
+        CellType cellType = cell.getCellTypeEnum();
         if (cellType == CellType.FORMULA) {
             if (evaluator == null) {
                 return cell.getCellFormula();
index 291ab549e6f3f21bd0f3cb7768dd53194284f488..2032753a0d2c8fe686b715d5cc4a783ca1f01f15 100644 (file)
@@ -81,7 +81,7 @@ public class SheetUtil {
         
         public void evaluateAll() {}
         public CellType evaluateFormulaCell(Cell cell) {
-            return cell.getCachedFormulaResultType();
+            return cell.getCachedFormulaResultTypeEnum();
         }
     };
 
@@ -120,11 +120,11 @@ public class SheetUtil {
         }
 
         CellStyle style = cell.getCellStyle();
-        CellType cellType = cell.getCellType();
+        CellType cellType = cell.getCellTypeEnum();
 
         // for formula cells we compute the cell width for the cached formula result
         if (cellType == CellType.FORMULA)
-            cellType = cell.getCachedFormulaResultType();
+            cellType = cell.getCachedFormulaResultTypeEnum();
 
         Font font = wb.getFontAt(style.getFontIndex());
 
index c72048ec26d693b0da64b84a2f049613026ffa37..b6fbbb3ffae5818f2597ae9cd821566bb9e587fb 100644 (file)
@@ -101,7 +101,7 @@ public class CellWalk {
     }
 
     private boolean isEmpty(Cell cell) {
-        return (cell.getCellType() == CellType.BLANK);
+        return (cell.getCellTypeEnum() == CellType.BLANK);
     }
 
     /**
index 719dd636e5634ea3df19b43c92242aa0bdd02d22..192d60d71be7740f7a7312a2b211fc60233907b9 100644 (file)
@@ -162,19 +162,19 @@ public class XSSFExcelExtractor extends POIXMLTextExtractor
                     Cell cell = ri.next();
 
                     // Is it a formula one?
-                    if(cell.getCellType() == CellType.FORMULA) {
+                    if(cell.getCellTypeEnum() == CellType.FORMULA) {
                         if (formulasNotResults) {
                             String contents = cell.getCellFormula();
                             checkMaxTextSize(text, contents);
                             text.append(contents);
                         } else {
-                            if (cell.getCachedFormulaResultType() == CellType.STRING) {
+                            if (cell.getCachedFormulaResultTypeEnum() == CellType.STRING) {
                                 handleStringCell(text, cell);
                             } else {
                                 handleNonStringCell(text, cell, formatter);
                             }
                         }
-                    } else if(cell.getCellType() == CellType.STRING) {
+                    } else if(cell.getCellTypeEnum() == CellType.STRING) {
                         handleStringCell(text, cell);
                     } else {
                         handleNonStringCell(text, cell, formatter);
@@ -236,9 +236,9 @@ public class XSSFExcelExtractor extends POIXMLTextExtractor
     }
 
     private void handleNonStringCell(StringBuffer text, Cell cell, DataFormatter formatter) {
-        CellType type = cell.getCellType();
+        CellType type = cell.getCellTypeEnum();
         if (type == CellType.FORMULA) {
-            type = cell.getCachedFormulaResultType();
+            type = cell.getCachedFormulaResultTypeEnum();
         }
 
         if (type == CellType.NUMERIC) {
index f9d3c876f17cabc1d0caae7c1cdbbeeb021c5f55..abba81430f49be77eabb402fbeb6660727bcec40 100644 (file)
@@ -278,13 +278,13 @@ public class XSSFExportToXml implements Comparator<String>{
     private void mapCellOnNode(XSSFCell cell, Node node, STXmlDataType.Enum  outputDataType) {
 
         String value ="";
-        switch (cell.getCellType()) {
+        switch (cell.getCellTypeEnum()) {
 
         case STRING: value = cell.getStringCellValue(); break;
         case BOOLEAN: value += cell.getBooleanCellValue(); break;
         case ERROR: value = cell.getErrorCellString();  break;
         case FORMULA:
-           if (cell.getCachedFormulaResultType() == CellType.STRING) {
+           if (cell.getCachedFormulaResultTypeEnum() == CellType.STRING) {
                value = cell.getStringCellValue();
            } else {
                if (DateUtil.isCellDateFormatted(cell)) {
index 5a6ac555e0f5f19a6884c6fd6e367bd93dadde9d..284d85ab86f50e4bccba7f5477bb7acbfcd8e3b4 100644 (file)
@@ -38,6 +38,7 @@ import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.util.CellAddress;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.ss.util.CellReference;
+import org.apache.poi.util.Internal;
 import org.apache.poi.util.LocaleUtil;
 import org.apache.poi.util.NotImplemented;
 import org.apache.poi.util.POILogFactory;
@@ -150,7 +151,20 @@ public class SXSSFCell implements Cell {
      * @return the cell type
      */
     @Override
-    public CellType getCellType()
+    public int getCellType()
+    {
+        return getCellTypeEnum().getCode();
+    }
+    
+    /**
+     * Return the cell type.
+     *
+     * @return the cell type
+     * @deprecated POI 3.15 beta 3
+     */
+    @Internal
+    @Override
+    public CellType getCellTypeEnum()
     {
         return _value.getType();
     }
@@ -162,7 +176,21 @@ public class SXSSFCell implements Cell {
      * on the cached value of the formula
      */
     @Override
-    public CellType getCachedFormulaResultType()
+    public int getCachedFormulaResultType()
+    {
+        return getCachedFormulaResultTypeEnum().getCode();
+    }
+
+    /**
+     * Only valid for formula cells
+     * @return one of ({@link CellType#NUMERIC}, {@link CellType#STRING},
+     *     {@link CellType#BOOLEAN}, {@link CellType#ERROR}) depending
+     * on the cached value of the formula
+     * @deprecated POI 3.15 beta 3.
+     */
+    @Internal
+    @Override
+    public CellType getCachedFormulaResultTypeEnum()
     {
         if (_value.getType() != CellType.FORMULA) {
             throw new IllegalStateException("Only formula cells have cached results");
@@ -330,7 +358,7 @@ public class SXSSFCell implements Cell {
      * Return a formula for the cell, for example, <code>SUM(C4:E4)</code>
      *
      * @return a formula for the cell
-     * @throws IllegalStateException if the cell type returned by {@link #getCellType()} is not CellType.FORMULA
+     * @throws IllegalStateException if the cell type returned by {@link #getCellTypeEnum()} is not CellType.FORMULA
      */
     @Override
     public String getCellFormula()
@@ -347,14 +375,14 @@ public class SXSSFCell implements Cell {
      * For formulas or error cells we return the precalculated value;
      * </p>
      * @return the value of the cell as a number
-     * @throws IllegalStateException if the cell type returned by {@link #getCellType()} is CellType.STRING
+     * @throws IllegalStateException if the cell type returned by {@link #getCellTypeEnum()} is CellType.STRING
      * @exception NumberFormatException if the cell value isn't a parsable <code>double</code>.
      * @see org.apache.poi.ss.usermodel.DataFormatter for turning this number into a string similar to that which Excel would render this number as.
      */
     @Override
     public double getNumericCellValue()
     {
-        CellType cellType = getCellType();
+        CellType cellType = getCellTypeEnum();
         switch(cellType) 
         {
             case BLANK:
@@ -379,14 +407,14 @@ public class SXSSFCell implements Cell {
      * For strings we throw an exception. For blank cells we return a null.
      * </p>
      * @return the value of the cell as a date
-     * @throws IllegalStateException if the cell type returned by {@link #getCellType()} is CellType.STRING
+     * @throws IllegalStateException if the cell type returned by {@link #getCellTypeEnum()} is CellType.STRING
      * @exception NumberFormatException if the cell value isn't a parsable <code>double</code>.
      * @see org.apache.poi.ss.usermodel.DataFormatter for formatting  this date into a string similar to how excel does.
      */
     @Override
     public Date getDateCellValue()
     {
-        CellType cellType = getCellType();
+        CellType cellType = getCellTypeEnum();
         if (cellType == CellType.BLANK) 
         {
             return null;
@@ -408,8 +436,8 @@ public class SXSSFCell implements Cell {
     @Override
     public RichTextString getRichStringCellValue()
     {
-        CellType cellType = getCellType();
-        if(getCellType() != CellType.STRING)
+        CellType cellType = getCellTypeEnum();
+        if(getCellTypeEnum() != CellType.STRING)
             throw typeMismatch(CellType.STRING, cellType, false);
 
         StringValue sval = (StringValue)_value;
@@ -433,7 +461,7 @@ public class SXSSFCell implements Cell {
     @Override
     public String getStringCellValue()
     {
-        CellType cellType = getCellType();
+        CellType cellType = getCellTypeEnum();
         switch(cellType) 
         {
             case BLANK:
@@ -499,13 +527,13 @@ public class SXSSFCell implements Cell {
      * For strings, numbers, and errors, we throw an exception. For blank cells we return a false.
      * </p>
      * @return the value of the cell as a boolean
-     * @throws IllegalStateException if the cell type returned by {@link #getCellType()}
+     * @throws IllegalStateException if the cell type returned by {@link #getCellTypeEnum()}
      *   is not CellType.BOOLEAN, CellType.BLANK or CellType.FORMULA
      */
     @Override
     public boolean getBooleanCellValue()
     {
-        CellType cellType = getCellType();
+        CellType cellType = getCellTypeEnum();
         switch(cellType) 
         {
             case BLANK:
@@ -534,13 +562,13 @@ public class SXSSFCell implements Cell {
      * </p>
      *
      * @return the value of the cell as an error code
-     * @throws IllegalStateException if the cell type returned by {@link #getCellType()} isn't CellType.ERROR
+     * @throws IllegalStateException if the cell type returned by {@link #getCellTypeEnum()} isn't CellType.ERROR
      * @see org.apache.poi.ss.usermodel.FormulaError for error codes
      */
     @Override
     public byte getErrorCellValue()
     {
-        CellType cellType = getCellType();
+        CellType cellType = getCellTypeEnum();
         switch(cellType) 
         {
             case BLANK:
@@ -714,7 +742,7 @@ public class SXSSFCell implements Cell {
      */
     @Override
     public String toString() {
-        switch (getCellType()) {
+        switch (getCellTypeEnum()) {
             case BLANK:
                 return "";
             case BOOLEAN:
@@ -733,7 +761,7 @@ public class SXSSFCell implements Cell {
             case STRING:
                 return getRichStringCellValue().toString();
             default:
-                return "Unknown Cell Type: " + getCellType();
+                return "Unknown Cell Type: " + getCellTypeEnum();
         }
     }
 
@@ -959,10 +987,10 @@ public class SXSSFCell implements Cell {
     }
 
     private boolean convertCellValueToBoolean() {
-        CellType cellType = getCellType();
+        CellType cellType = getCellTypeEnum();
 
         if (cellType == CellType.FORMULA) {
-            cellType = getCachedFormulaResultType();
+            cellType = getCachedFormulaResultTypeEnum();
         }
 
         switch (cellType) {
@@ -982,7 +1010,7 @@ public class SXSSFCell implements Cell {
         
     }
     private String convertCellValueToString() {
-        CellType cellType = getCellType();
+        CellType cellType = getCellTypeEnum();
         return convertCellValueToString(cellType);
     }
     private String convertCellValueToString(CellType cellType) {
index e5e18ceac0a2f75d56adeae3c1526d73a3c80913..73af9aa74ea7488a4b592dd4ed1659fef82e7d9b 100644 (file)
@@ -20,6 +20,7 @@ package org.apache.poi.xssf.streaming;
 import org.apache.poi.ss.formula.EvaluationCell;
 import org.apache.poi.ss.formula.EvaluationSheet;
 import org.apache.poi.ss.usermodel.CellType;
+import org.apache.poi.util.Internal;
 
 /**
  * SXSSF wrapper for a cell under evaluation
@@ -51,10 +52,22 @@ final class SXSSFEvaluationCell implements EvaluationCell {
     public boolean getBooleanCellValue() {
         return _cell.getBooleanCellValue();
     }
+    /**
+     * Will return {@link CellType} in a future version of POI.
+     * For forwards compatibility, do not hard-code cell type literals in your code.
+     *
+     * @return cell type
+     */
     @Override
-    public CellType getCellType() {
+    public int getCellType() {
         return _cell.getCellType();
     }
+    /** @deprecated POI 3.15 beta 3 */
+    @Internal
+    @Override
+    public CellType getCellTypeEnum() {
+        return _cell.getCellTypeEnum();
+    }
     @Override
     public int getColumnIndex() {
         return _cell.getColumnIndex();
@@ -78,9 +91,21 @@ final class SXSSFEvaluationCell implements EvaluationCell {
     @Override
     public String getStringCellValue() {\r
         return _cell.getRichStringCellValue().getString();\r
-    }\r
+    }
+    /**
+     * Will return {@link CellType} in a future version of POI.
+     * For forwards compatibility, do not hard-code cell type literals in your code.
+     *
+     * @return cell type of cached formula result
+     */
+    @Override
+    public int getCachedFormulaResultType() {
+        return _cell.getCachedFormulaResultType();
+    }
+    /** @deprecated POI 3.15 beta 3 */
+    @Internal\r
     @Override
-    public CellType getCachedFormulaResultType() {\r
-        return _cell.getCachedFormulaResultType();\r
+    public CellType getCachedFormulaResultTypeEnum() {\r
+        return _cell.getCachedFormulaResultTypeEnum();\r
     }\r
 }\r
index 965534f34bcb4b345fc7c2087de6f07bcb82ede8..52b7342dd5295ec36c3e0599aa068d884a8311f3 100644 (file)
@@ -121,7 +121,7 @@ public final class SXSSFFormulaEvaluator extends BaseXSSFFormulaEvaluator {
             // Evaluate what we have
             for (Row r : sheet) {
                 for (Cell c : r) {
-                    if (c.getCellType() == CellType.FORMULA) {
+                    if (c.getCellTypeEnum() == CellType.FORMULA) {
                         eval.evaluateFormulaCell(c);
                     }
                 }
index a1eb96566399054779a6d366b9d858011c1aec15..7aaacdd9b0ee3282fc1c4b006362ed6f1267f76c 100644 (file)
@@ -268,7 +268,7 @@ public class SXSSFRow implements Row, Comparable<SXSSFRow>
             case RETURN_NULL_AND_BLANK:
                 return cell;
             case RETURN_BLANK_AS_NULL:
-                boolean isBlank = (cell != null && cell.getCellType() == CellType.BLANK);
+                boolean isBlank = (cell != null && cell.getCellTypeEnum() == CellType.BLANK);
                 return (isBlank) ? null : cell;
             case CREATE_NULL_AS_BLANK:
                 return (cell == null) ? createCell(cellnum, CellType.BLANK) : cell;
index 455254aa6b5c945d00a151ea30271ee70834ae16..4bd0c6bad96929537a48b3cebd2e0bdd2ddf3da6 100644 (file)
@@ -202,7 +202,7 @@ public class SheetDataWriter {
             // APIs\r
             _out.write(" s=\"" + (cellStyle.getIndex() & 0xffff) + "\"");\r
         }\r
-        CellType cellType = cell.getCellType();\r
+        CellType cellType = cell.getCellTypeEnum();\r
         switch (cellType) {\r
             case BLANK: {\r
                 _out.write(">");\r
@@ -213,7 +213,7 @@ public class SheetDataWriter {
                 _out.write("<f>");\r
                 outputQuotedString(cell.getCellFormula());\r
                 _out.write("</f>");\r
-                switch (cell.getCachedFormulaResultType()) {\r
+                switch (cell.getCachedFormulaResultTypeEnum()) {\r
                     case NUMERIC:\r
                         double nval = cell.getNumericCellValue();\r
                         if (!Double.isNaN(nval)) {\r
index 6d337f44652c19db9030508c69b6dbed9801568e..4b54ee9f1a0779d54894f246394b7eb7d831df9e 100644 (file)
@@ -75,7 +75,7 @@ public abstract class BaseXSSFFormulaEvaluator implements FormulaEvaluator, Work
             return null;
         }
 
-        switch (cell.getCellType()) {
+        switch (cell.getCellTypeEnum()) {
             case BOOLEAN:
                 return CellValue.valueOf(cell.getBooleanCellValue());
             case ERROR:
@@ -89,7 +89,7 @@ public abstract class BaseXSSFFormulaEvaluator implements FormulaEvaluator, Work
             case BLANK:
                 return null;
             default:
-                throw new IllegalStateException("Bad cell type (" + cell.getCellType() + ")");
+                throw new IllegalStateException("Bad cell type (" + cell.getCellTypeEnum() + ")");
         }
     }
 
@@ -113,7 +113,7 @@ public abstract class BaseXSSFFormulaEvaluator implements FormulaEvaluator, Work
      * @return The type of the formula result (the cell's type remains as CellType.FORMULA however)
      */
     public CellType evaluateFormulaCell(Cell cell) {
-        if (cell == null || cell.getCellType() != CellType.FORMULA) {
+        if (cell == null || cell.getCellTypeEnum() != CellType.FORMULA) {
             return CellType._UNINITIALIZED;
         }
         CellValue cv = evaluateFormulaCellValue(cell);
@@ -131,7 +131,7 @@ public abstract class BaseXSSFFormulaEvaluator implements FormulaEvaluator, Work
      */
     protected void doEvaluateInCell(Cell cell) {
         if (cell == null) return;
-        if (cell.getCellType() == CellType.FORMULA) {
+        if (cell.getCellTypeEnum() == CellType.FORMULA) {
             CellValue cv = evaluateFormulaCellValue(cell);
             setCellType(cell, cv); // cell will no longer be a formula cell
             setCellValue(cell, cv);
index 25d8cc832461a4b05e9d3c834fbc84e1da83254f..850f398d1668b03a736938ae5a445af1a58d339d 100644 (file)
@@ -138,11 +138,11 @@ public final class XSSFCell implements Cell {
         // Copy cell value (cell type is updated implicitly)
         if (policy.isCopyCellValue()) {
             if (srcCell != null) {
-                CellType copyCellType = srcCell.getCellType();
+                CellType copyCellType = srcCell.getCellTypeEnum();
                 if (copyCellType == CellType.FORMULA && !policy.isCopyCellFormula()) {
                     // Copy formula result as value
                     // FIXME: Cached value may be stale
-                    copyCellType = srcCell.getCachedFormulaResultType();
+                    copyCellType = srcCell.getCachedFormulaResultTypeEnum();
                 }
                 switch (copyCellType) {
                     case NUMERIC:
@@ -171,7 +171,7 @@ public final class XSSFCell implements Cell {
                         break;
 
                     default:
-                        throw new IllegalArgumentException("Invalid cell type " + srcCell.getCellType());
+                        throw new IllegalArgumentException("Invalid cell type " + srcCell.getCellTypeEnum());
                 }
             } else { //srcCell is null
                 setBlank();
@@ -249,12 +249,12 @@ public final class XSSFCell implements Cell {
      * For strings, numbers, and errors, we throw an exception. For blank cells we return a false.
      * </p>
      * @return the value of the cell as a boolean
-     * @throws IllegalStateException if the cell type returned by {@link #getCellType()}
+     * @throws IllegalStateException if the cell type returned by {@link #getCellTypeEnum()}
      *   is not {@link CellType#BOOLEAN}, {@link CellType#BLANK} or {@link CellType#FORMULA}
      */
     @Override
     public boolean getBooleanCellValue() {
-        CellType cellType = getCellType();
+        CellType cellType = getCellTypeEnum();
         switch(cellType) {
             case BLANK:
                 return false;
@@ -288,13 +288,13 @@ public final class XSSFCell implements Cell {
      * For formulas or error cells we return the precalculated value;
      * </p>
      * @return the value of the cell as a number
-     * @throws IllegalStateException if the cell type returned by {@link #getCellType()} is {@link CellType#STRING}
+     * @throws IllegalStateException if the cell type returned by {@link #getCellTypeEnum()} is {@link CellType#STRING}
      * @exception NumberFormatException if the cell value isn't a parsable <code>double</code>.
      * @see DataFormatter for turning this number into a string similar to that which Excel would render this number as.
      */
     @Override
     public double getNumericCellValue() {
-        CellType cellType = getCellType();
+        CellType cellType = getCellTypeEnum();
         switch(cellType) {
             case BLANK:
                 return 0.0;
@@ -366,7 +366,7 @@ public final class XSSFCell implements Cell {
      */
     @Override
     public XSSFRichTextString getRichStringCellValue() {
-        CellType cellType = getCellType();
+        CellType cellType = getCellTypeEnum();
         XSSFRichTextString rt;
         switch (cellType) {
             case BLANK:
@@ -445,7 +445,7 @@ public final class XSSFCell implements Cell {
             throw new IllegalArgumentException("The maximum length of cell contents (text) is 32,767 characters");
         }
 
-        CellType cellType = getCellType();
+        CellType cellType = getCellTypeEnum();
         switch (cellType){
             case FORMULA:
                 _cell.setV(str.getString());
@@ -470,7 +470,7 @@ public final class XSSFCell implements Cell {
      * Return a formula for the cell, for example, <code>SUM(C4:E4)</code>
      *
      * @return a formula for the cell
-     * @throws IllegalStateException if the cell type returned by {@link #getCellType()} is not {@link CellType#FORMULA}
+     * @throws IllegalStateException if the cell type returned by {@link #getCellTypeEnum()} is not {@link CellType#FORMULA}
      */
     @Override
     public String getCellFormula() {
@@ -483,10 +483,10 @@ public final class XSSFCell implements Cell {
      *
      * @param fpb evaluation workbook for reuse, if available, or null to create a new one as needed
      * @return a formula for the cell
-     * @throws IllegalStateException if the cell type returned by {@link #getCellType()} is not {@link CellType#FORMULA}
+     * @throws IllegalStateException if the cell type returned by {@link #getCellTypeEnum()} is not {@link CellType#FORMULA}
      */
     protected String getCellFormula(XSSFEvaluationWorkbook fpb) {
-        CellType cellType = getCellType();
+        CellType cellType = getCellTypeEnum();
         if(cellType != CellType.FORMULA) throw typeMismatch(CellType.FORMULA, cellType, false);
 
         CTCellFormula f = _cell.getF();
@@ -660,27 +660,59 @@ public final class XSSFCell implements Cell {
         }
         return false;
     }
+    
+    /**
+     * Return the cell type.
+     * 
+     * Will return {@link CellType} in a future version of POI.
+     * For forwards compatibility, do not hard-code cell type literals in your code.
+     *
+     * @return the cell type
+     */
+    @Override
+    public int getCellType() {
+        return getCellTypeEnum().getCode();
+    }
 
     /**
      * Return the cell type.
      *
      * @return the cell type
+     * @deprecated POI 3.15 beta 3
      */
+    @Internal
     @Override
-    public CellType getCellType() {
+    public CellType getCellTypeEnum() {
         if (isFormulaCell()) return CellType.FORMULA;
 
         return getBaseCellType(true);
     }
 
+    /**
+     * Only valid for formula cells
+     * 
+     * Will return {@link CellType} in a future version of POI.
+     * For forwards compatibility, do not hard-code cell type literals in your code.
+     * 
+     * @return one of ({@link CellType#NUMERIC}, {@link CellType#STRING},
+     *     {@link CellType#BOOLEAN}, {@link CellType#ERROR}) depending
+     * on the cached value of the formula
+     */
+    @Override
+    public int getCachedFormulaResultType() {
+        return getCachedFormulaResultTypeEnum().getCode();
+    }
+    
     /**
      * Only valid for formula cells
      * @return one of ({@link CellType#NUMERIC}, {@link CellType#STRING},
      *     {@link CellType#BOOLEAN}, {@link CellType#ERROR}) depending
      * on the cached value of the formula
+     * @deprecated POI 3.15 beta 3
      */
+    @Internal
     @Override
-    public CellType getCachedFormulaResultType() {
+    public CellType getCachedFormulaResultTypeEnum() {
         if (! isFormulaCell()) {
             throw new IllegalStateException("Only formula cells have cached results");
         }
@@ -722,13 +754,13 @@ public final class XSSFCell implements Cell {
      * For strings we throw an exception. For blank cells we return a null.
      * </p>
      * @return the value of the cell as a date
-     * @throws IllegalStateException if the cell type returned by {@link #getCellType()} is {@link CellType#STRING}
+     * @throws IllegalStateException if the cell type returned by {@link #getCellTypeEnum()} is {@link CellType#STRING}
      * @exception NumberFormatException if the cell value isn't a parsable <code>double</code>.
      * @see DataFormatter for formatting  this date into a string similar to how excel does.
      */
     @Override
     public Date getDateCellValue() {
-        if (getCellType() == CellType.BLANK) {
+        if (getCellTypeEnum() == CellType.BLANK) {
             return null;
         }
 
@@ -787,7 +819,7 @@ public final class XSSFCell implements Cell {
      * Returns the error message, such as #VALUE!
      *
      * @return the error message such as #VALUE!
-     * @throws IllegalStateException if the cell type returned by {@link #getCellType()} isn't {@link CellType#ERROR}
+     * @throws IllegalStateException if the cell type returned by {@link #getCellTypeEnum()} isn't {@link CellType#ERROR}
      * @see FormulaError
      */
     public String getErrorCellString() {
@@ -804,7 +836,7 @@ public final class XSSFCell implements Cell {
      * </p>
      *
      * @return the value of the cell as an error code
-     * @throws IllegalStateException if the cell type returned by {@link #getCellType()} isn't {@link CellType #ERROR}
+     * @throws IllegalStateException if the cell type returned by {@link #getCellTypeEnum()} isn't {@link CellType #ERROR}
      * @see FormulaError
      */
     @Override
@@ -899,7 +931,7 @@ public final class XSSFCell implements Cell {
      */
     @Override
     public void setCellType(CellType cellType) {
-        CellType prevType = getCellType();
+        CellType prevType = getCellTypeEnum();
 
         if(isPartOfArrayFormulaGroup()){
             notifyArrayFormulaChanging();
@@ -962,7 +994,7 @@ public final class XSSFCell implements Cell {
      */
     @Override
     public String toString() {
-        switch (getCellType()) {
+        switch (getCellTypeEnum()) {
             case NUMERIC:
                 if (DateUtil.isCellDateFormatted(this)) {
                     DateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy", LocaleUtil.getUserLocale());
@@ -981,7 +1013,7 @@ public final class XSSFCell implements Cell {
             case ERROR:
                 return ErrorEval.getText(getErrorCellValue());
             default:
-                return "Unknown Cell Type: " + getCellType();
+                return "Unknown Cell Type: " + getCellTypeEnum();
         }
     }
 
@@ -1133,7 +1165,7 @@ public final class XSSFCell implements Cell {
      * TODO - perhaps a method like setCellTypeAndValue(int, Object) should be introduced to avoid this
      */
     private boolean convertCellValueToBoolean() {
-        CellType cellType = getCellType();
+        CellType cellType = getCellTypeEnum();
 
         if (cellType == CellType.FORMULA) {
             cellType = getBaseCellType(false);
@@ -1161,7 +1193,7 @@ public final class XSSFCell implements Cell {
     }
 
     private String convertCellValueToString() {
-        CellType cellType = getCellType();
+        CellType cellType = getCellTypeEnum();
 
         switch (cellType) {
             case BLANK:
index 40b44001ab4eac281826bfc419cd09d7aa244b65..25a0cf2839f9fa295d920d646042e64f4c3914e1 100644 (file)
@@ -20,6 +20,7 @@ package org.apache.poi.xssf.usermodel;
 import org.apache.poi.ss.formula.EvaluationCell;
 import org.apache.poi.ss.formula.EvaluationSheet;
 import org.apache.poi.ss.usermodel.CellType;
+import org.apache.poi.util.Internal;
 
 /**
  * XSSF wrapper for a cell under evaluation
@@ -52,10 +53,22 @@ final class XSSFEvaluationCell implements EvaluationCell {
        public boolean getBooleanCellValue() {
                return _cell.getBooleanCellValue();
        }
+/**
+        * Will return {@link CellType} in a future version of POI.
+        * For forwards compatibility, do not hard-code cell type literals in your code.
+        *
+        * @return cell type
+        */
        @Override
-       public CellType getCellType() {
+       public int getCellType() {
                return _cell.getCellType();
        }
+       /** @deprecated POI 3.15 beta 3 */
+       @Internal
+       @Override
+       public CellType getCellTypeEnum() {
+               return _cell.getCellTypeEnum();
+       }
        @Override
        public int getColumnIndex() {
                return _cell.getColumnIndex();
@@ -79,9 +92,21 @@ final class XSSFEvaluationCell implements EvaluationCell {
        @Override
        public String getStringCellValue() {\r
                return _cell.getRichStringCellValue().getString();\r
-       }\r
+       }
+       /**
+        * Will return {@link CellType} in a future version of POI.
+        * For forwards compatibility, do not hard-code cell type literals in your code.
+        *
+        * @return cell type of cached formula result
+        */
+       @Override
+       public int getCachedFormulaResultType() {
+               return _cell.getCachedFormulaResultType();
+       }
+       /** @deprecated POI 3.15 beta 3 */
+       @Internal\r
        @Override
-       public CellType getCachedFormulaResultType() {\r
-               return _cell.getCachedFormulaResultType();\r
+       public CellType getCachedFormulaResultTypeEnum() {\r
+               return _cell.getCachedFormulaResultTypeEnum();\r
        }\r
 }\r
index 8196abfb45395e1b7e22a8fbb740306fd9417bc7..e936ed554df102af4623e3e5cdba857b05347f77 100644 (file)
@@ -276,7 +276,7 @@ public class XSSFRow implements Row, Comparable<XSSFRow> {
             case RETURN_NULL_AND_BLANK:
                 return cell;
             case RETURN_BLANK_AS_NULL:
-                boolean isBlank = (cell != null && cell.getCellType() == CellType.BLANK);
+                boolean isBlank = (cell != null && cell.getCellTypeEnum() == CellType.BLANK);
                 return (isBlank) ? null : cell;
             case CREATE_NULL_AS_BLANK:
                 return (cell == null) ? createCell(cellnum, CellType.BLANK) : cell;
@@ -496,7 +496,7 @@ public class XSSFRow implements Row, Comparable<XSSFRow> {
         if(xcell.isPartOfArrayFormulaGroup()) {
             xcell.notifyArrayFormulaChanging();
         }
-        if(cell.getCellType() == CellType.FORMULA) {
+        if(cell.getCellTypeEnum() == CellType.FORMULA) {
            _sheet.getWorkbook().onDeleteFormula(xcell);
         }
         // Performance optimization for bug 57840: explicit boxing is slightly faster than auto-unboxing, though may use more memory
@@ -636,7 +636,7 @@ public class XSSFRow implements Row, Comparable<XSSFRow> {
         else {
             for (final Cell c : srcRow){
                 final XSSFCell srcCell = (XSSFCell)c;
-                final XSSFCell destCell = createCell(srcCell.getColumnIndex(), srcCell.getCellType());
+                final XSSFCell destCell = createCell(srcCell.getColumnIndex(), srcCell.getCellTypeEnum());
                 destCell.copyCellFrom(srcCell, policy);
             }
 
index 107e205b98c8c164052e4074352541a8c722ec57..1d146c09c642f1ddfa66f2121ba353da7b52c264 100644 (file)
@@ -77,7 +77,7 @@ public final class XSSFFormulaUtils {
         for (Sheet sh : _wb) {
             for (Row row : sh) {
                 for (Cell cell : row) {
-                    if (cell.getCellType() == CellType.FORMULA) {
+                    if (cell.getCellTypeEnum() == CellType.FORMULA) {
                         updateFormula((XSSFCell) cell, oldName, newName);
                     }
                 }
index 42cf2714a5c20bbf5f0f06c43a3bdbe73a96999a..d2fd60f3ead5edad43799070300fb864a6b0f258 100644 (file)
@@ -42,7 +42,7 @@ public final class TestCalculationChain extends TestCase {
         XSSFSheet sheet = wb.getSheet("Test");
         XSSFCell cell = sheet.getRow(0).getCell(4);
 
-        assertEquals(CellType.FORMULA, cell.getCellType());
+        assertEquals(CellType.FORMULA, cell.getCellTypeEnum());
         cell.setCellFormula(null);
 
         //the count of items is less by one
@@ -53,9 +53,9 @@ public final class TestCalculationChain extends TestCase {
         assertEquals(10, c.getI());
         assertEquals("C1", c.getR());
 
-        assertEquals(CellType.STRING, cell.getCellType());
+        assertEquals(CellType.STRING, cell.getCellTypeEnum());
         cell.setCellValue("ABC");
-        assertEquals(CellType.STRING, cell.getCellType());
+        assertEquals(CellType.STRING, cell.getCellTypeEnum());
     }
 
 
index 23f4ae3912a3bf608cb519d63d543a2e4b2cdf21..4cbc7c4e61c4cfa6caef1ece622d9344b4c6249d 100644 (file)
@@ -190,7 +190,7 @@ public final class TestFormulaEvaluatorOnXSSF {
                for (short colnum=SS.COLUMN_INDEX_FIRST_TEST_VALUE; colnum < endcolnum; colnum++) {
                        Cell c = formulasRow.getCell(colnum);
                        assumeNotNull(c);
-                       assumeTrue(c.getCellType() == CellType.FORMULA);
+                       assumeTrue(c.getCellTypeEnum() == CellType.FORMULA);
                        ignoredFormulaTestCase(c.getCellFormula());
 
                        CellValue actValue = evaluator.evaluate(c);
@@ -202,7 +202,7 @@ public final class TestFormulaEvaluatorOnXSSF {
                        assertNotNull(msg + " - Bad setup data expected value is null", expValue);
                        assertNotNull(msg + " - actual value was null", actValue);
                
-               final CellType expectedCellType = expValue.getCellType();
+               final CellType expectedCellType = expValue.getCellTypeEnum();
                switch (expectedCellType) {
                    case BLANK:
                        assertEquals(msg, CellType.BLANK, actValue.getCellType());
@@ -264,10 +264,10 @@ public final class TestFormulaEvaluatorOnXSSF {
             logger.log(POILogger.WARN, "Warning - Row " + r.getRowNum() + " has no cell " + SS.COLUMN_INDEX_FUNCTION_NAME + ", can't figure out function name");
                        return null;
                }
-               if(cell.getCellType() == CellType.BLANK) {
+               if(cell.getCellTypeEnum() == CellType.BLANK) {
                        return null;
                }
-               if(cell.getCellType() == CellType.STRING) {
+               if(cell.getCellTypeEnum() == CellType.STRING) {
                        return cell.getRichStringCellValue().getString();
                }
                
index a237cefe60c0d263f76400f35abdfd7f4a6f8df4..f33d96e637ed8ae2889325ae3727c385e2bc4897 100644 (file)
@@ -176,7 +176,7 @@ public final class TestMultiSheetFormulaEvaluatorOnXSSF {
 
         Cell c = r.getCell(SS.COLUMN_INDEX_ACTUAL_VALUE);
         assumeNotNull(c);
-        assumeTrue(c.getCellType() == CellType.FORMULA);
+        assumeTrue(c.getCellTypeEnum() == CellType.FORMULA);
 
         CellValue actValue = evaluator.evaluate(c);
 
@@ -185,7 +185,7 @@ public final class TestMultiSheetFormulaEvaluatorOnXSSF {
 
         assertNotNull(msg + " - actual value was null", actValue);
 
-        final CellType expectedCellType = expValue.getCellType();
+        final CellType expectedCellType = expValue.getCellTypeEnum();
         switch (expectedCellType) {
             case BLANK:
                 assertEquals(msg, CellType.BLANK, actValue.getCellType());
@@ -231,15 +231,15 @@ public final class TestMultiSheetFormulaEvaluatorOnXSSF {
             logger.log(POILogger.WARN, "Warning - Row " + r.getRowNum() + " has no cell " + SS.COLUMN_INDEX_FUNCTION_NAME + ", can't figure out function name");
                        return null;
                }
-               if(cell.getCellType() == CellType.BLANK) {
+               if(cell.getCellTypeEnum() == CellType.BLANK) {
                        return null;
                }
-               if(cell.getCellType() == CellType.STRING) {
+               if(cell.getCellTypeEnum() == CellType.STRING) {
                        return cell.getRichStringCellValue().getString();
                }
 
                fail("Bad cell type for 'function name' column: ("
-                       + cell.getCellType() + ") row (" + (r.getRowNum() +1) + ")");
+                       + cell.getCellTypeEnum() + ") row (" + (r.getRowNum() +1) + ")");
                return "";
        }
        /**
@@ -255,15 +255,15 @@ public final class TestMultiSheetFormulaEvaluatorOnXSSF {
                    logger.log(POILogger.WARN, "Warning - Row " + r.getRowNum() + " has no cell " + SS.COLUMN_INDEX_TEST_NAME + ", can't figure out test name");
                        return null;
                }
-               if(cell.getCellType() == CellType.BLANK) {
+               if(cell.getCellTypeEnum() == CellType.BLANK) {
                        return null;
                }
-               if(cell.getCellType() == CellType.STRING) {
+               if(cell.getCellTypeEnum() == CellType.STRING) {
                        return cell.getRichStringCellValue().getString();
                }
 
                fail("Bad cell type for 'test name' column: ("
-                       + cell.getCellType() + ") row (" + (r.getRowNum() +1) + ")");
+                       + cell.getCellTypeEnum() + ") row (" + (r.getRowNum() +1) + ")");
                return "";
        }
 
index 02253a64ebc907e168755cc8073f0f8d045eb78e..8965810250ffb20c3fa4f974cda7bf7f183acd46 100644 (file)
@@ -300,7 +300,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
                 Sheet s = wb.getSheetAt(i);
                 for(Row r : s) {
                     for(Cell c : r) {
-                        if(c.getCellType() == CellType.FORMULA) {
+                        if(c.getCellTypeEnum() == CellType.FORMULA) {
                             CellValue cv = eval.evaluate(c);
 
                             if(cv.getCellType() == CellType.NUMERIC) {
@@ -424,7 +424,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
 
         cell = sheet.getRow(0).getCell(0);
         assertEquals("#REF!*#REF!", cell.getCellFormula());
-        assertEquals(CellType.ERROR, evaluator.evaluateInCell(cell).getCellType());
+        assertEquals(CellType.ERROR, evaluator.evaluateInCell(cell).getCellTypeEnum());
         assertEquals("#REF!", FormulaError.forInt(cell.getErrorCellValue()).getString());
 
         Name nm1 = wb.getName("sale_1");
@@ -436,7 +436,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
 
         cell = sheet.getRow(1).getCell(0);
         assertEquals("sale_1*sale_2", cell.getCellFormula());
-        assertEquals(CellType.ERROR, evaluator.evaluateInCell(cell).getCellType());
+        assertEquals(CellType.ERROR, evaluator.evaluateInCell(cell).getCellTypeEnum());
         assertEquals("#REF!", FormulaError.forInt(cell.getErrorCellValue()).getString());
         
         wb.close();
@@ -642,7 +642,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
         Sheet sheet = wb.getSheetAt(0);
         for(Row row : sheet){
             for(Cell cell : row){
-                if(cell.getCellType() == CellType.FORMULA){
+                if(cell.getCellTypeEnum() == CellType.FORMULA){
                     formulaEvaluator.evaluateInCell(cell); // caused NPE on some cells
                 }
             }
@@ -1696,7 +1696,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
 
         // Get wrong cell by row 8 & column 7
         Cell cell = sheet.getRow(8).getCell(7);
-        assertEquals(CellType.NUMERIC, cell.getCellType());
+        assertEquals(CellType.NUMERIC, cell.getCellTypeEnum());
 
         // Check the value - will be zero as it is <c><v/></c>
         assertEquals(0.0, cell.getNumericCellValue(), 0.001);
@@ -2182,7 +2182,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
 
         Sheet sheet = wb.getSheet("Sheet1");
         Cell cell = sheet.getRow(5).getCell(4);
-        assertEquals(CellType.FORMULA, cell.getCellType());
+        assertEquals(CellType.FORMULA, cell.getCellTypeEnum());
         assertEquals("E4+E5", cell.getCellFormula());
 
         CellValue value = evaluator.evaluate(cell);
@@ -2541,7 +2541,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
                 if(cell == null){
                     cell = row.createCell(cellnum);
                 } else {
-                    if(cell.getCellType() == CellType.FORMULA) {
+                    if(cell.getCellTypeEnum() == CellType.FORMULA) {
                         cell.setCellFormula(null);
                         cell.getCellStyle().setDataFormat((short) 0);
                     }
@@ -2607,13 +2607,13 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
     }
 
     private void assertFormula(Workbook wb, Cell intF, String expectedFormula, String expectedResultOrNull) {
-        assertEquals(CellType.FORMULA, intF.getCellType());
+        assertEquals(CellType.FORMULA, intF.getCellTypeEnum());
         if (null == expectedResultOrNull) {
-            assertEquals(CellType.ERROR, intF.getCachedFormulaResultType());
+            assertEquals(CellType.ERROR, intF.getCachedFormulaResultTypeEnum());
             expectedResultOrNull = "#VALUE!";
         }
         else {
-            assertEquals(CellType.NUMERIC, intF.getCachedFormulaResultType());
+            assertEquals(CellType.NUMERIC, intF.getCachedFormulaResultTypeEnum());
         }
 
         assertEquals(expectedFormula, intF.getCellFormula());
@@ -2654,7 +2654,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
         Sheet sheet = wb.getSheet("Sheet1");
         for(Row aRow : sheet) {
             Cell cell = aRow.getCell(1);
-            if(cell.getCellType() == CellType.FORMULA) {
+            if(cell.getCellTypeEnum() == CellType.FORMULA) {
                 String formula = cell.getCellFormula();
                 //System.out.println("formula: " + formula);
                 assertNotNull(formula);
@@ -2958,14 +2958,14 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
         row = worksheet.getRow(2);
         cell = row.getCell(1);
 
-        assertEquals(CellType.BLANK, cell.getCellType());
+        assertEquals(CellType.BLANK, cell.getCellTypeEnum());
         assertEquals(CellType._UNINITIALIZED, evaluator.evaluateFormulaCell(cell));
 
         // A3
         row = worksheet.getRow(2);
         cell = row.getCell(0);
 
-        assertEquals(CellType.FORMULA, cell.getCellType());
+        assertEquals(CellType.FORMULA, cell.getCellTypeEnum());
         assertEquals("IF(ISBLANK(B3),\"\",B3)", cell.getCellFormula());
         assertEquals(CellType.STRING, evaluator.evaluateFormulaCell(cell));
         CellValue value = evaluator.evaluate(cell);
@@ -2975,7 +2975,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
         row = worksheet.getRow(4);
         cell = row.getCell(0);
 
-        assertEquals(CellType.FORMULA, cell.getCellType());
+        assertEquals(CellType.FORMULA, cell.getCellTypeEnum());
         assertEquals("COUNTBLANK(A1:A4)", cell.getCellFormula());
         assertEquals(CellType.NUMERIC, evaluator.evaluateFormulaCell(cell));
         value = evaluator.evaluate(cell);
index 8c6951de18032b9775a1838407a4b3390a2d8a5c..ab7406eed4622de2acf7022a2e4f2042e6a062b8 100644 (file)
@@ -134,13 +134,13 @@ public final class TestXSSFCell extends BaseTestXCell {
         assertNull(str.getString());
         cell_0.setCellValue(str);
         assertEquals(0, sst.getCount());
-        assertEquals(CellType.BLANK, cell_0.getCellType());
+        assertEquals(CellType.BLANK, cell_0.getCellTypeEnum());
 
         //case 2. cell.setCellValue((String)null);
         Cell cell_1 = row.createCell(1);
         cell_1.setCellValue((String)null);
         assertEquals(0, sst.getCount());
-        assertEquals(CellType.BLANK, cell_1.getCellType());
+        assertEquals(CellType.BLANK, cell_1.getCellTypeEnum());
         wb.close();
     }
 
@@ -152,7 +152,7 @@ public final class TestXSSFCell extends BaseTestXCell {
             CTCell ctCell = cell.getCTCell(); //low-level bean holding cell's xml
     
             cell.setCellFormula("A2");
-            assertEquals(CellType.FORMULA, cell.getCellType());
+            assertEquals(CellType.FORMULA, cell.getCellTypeEnum());
             assertEquals("A2", cell.getCellFormula());
             //the value is not set and cell's type='N' which means blank
             assertEquals(STCellType.N, ctCell.getT());
@@ -160,7 +160,7 @@ public final class TestXSSFCell extends BaseTestXCell {
             //set cached formula value
             cell.setCellValue("t='str'");
             //we are still of 'formula' type
-            assertEquals(CellType.FORMULA, cell.getCellType());
+            assertEquals(CellType.FORMULA, cell.getCellTypeEnum());
             assertEquals("A2", cell.getCellFormula());
             //cached formula value is set and cell's type='STR'
             assertEquals(STCellType.STR, ctCell.getT());
@@ -168,14 +168,14 @@ public final class TestXSSFCell extends BaseTestXCell {
     
             //now remove the formula, the cached formula result remains
             cell.setCellFormula(null);
-            assertEquals(CellType.STRING, cell.getCellType());
+            assertEquals(CellType.STRING, cell.getCellTypeEnum());
             assertEquals(STCellType.STR, ctCell.getT());
             //the line below failed prior to fix of Bug #47889
             assertEquals("t='str'", cell.getStringCellValue());
     
             //revert to a blank cell
             cell.setCellValue((String)null);
-            assertEquals(CellType.BLANK, cell.getCellType());
+            assertEquals(CellType.BLANK, cell.getCellTypeEnum());
             assertEquals(STCellType.N, ctCell.getT());
             assertEquals("", cell.getStringCellValue());
         } finally {
@@ -195,7 +195,7 @@ public final class TestXSSFCell extends BaseTestXCell {
 
         //try a string cell
         cell = sh.getRow(0).getCell(0);
-        assertEquals(CellType.STRING, cell.getCellType());
+        assertEquals(CellType.STRING, cell.getCellTypeEnum());
         assertEquals("a", cell.getStringCellValue());
         assertEquals("a", cell.toString());
         //Gnumeric produces spreadsheets without styles
@@ -204,7 +204,7 @@ public final class TestXSSFCell extends BaseTestXCell {
 
         //try a numeric cell
         cell = sh.getRow(1).getCell(0);
-        assertEquals(CellType.NUMERIC, cell.getCellType());
+        assertEquals(CellType.NUMERIC, cell.getCellTypeEnum());
         assertEquals(1.0, cell.getNumericCellValue(), 0);
         assertEquals("1.0", cell.toString());
         //Gnumeric produces spreadsheets without styles
@@ -514,7 +514,7 @@ public final class TestXSSFCell extends BaseTestXCell {
         final CellCopyPolicy policy = new CellCopyPolicy();
         destCell.copyCellFrom(srcCell, policy);
         
-        assertEquals(CellType.FORMULA, destCell.getCellType());
+        assertEquals(CellType.FORMULA, destCell.getCellTypeEnum());
         assertEquals("2+3", destCell.getCellFormula());
         assertEquals(srcCell.getCellStyle(), destCell.getCellStyle());
     }
@@ -526,7 +526,7 @@ public final class TestXSSFCell extends BaseTestXCell {
         // Paste values only
         final CellCopyPolicy policy = new CellCopyPolicy.Builder().cellFormula(false).build();
         destCell.copyCellFrom(srcCell, policy);
-        assertEquals(CellType.NUMERIC, destCell.getCellType());
+        assertEquals(CellType.NUMERIC, destCell.getCellTypeEnum());
     }
     
     @Test
@@ -553,8 +553,8 @@ public final class TestXSSFCell extends BaseTestXCell {
         assertEquals(srcCell.getCellStyle(), destCell.getCellStyle());
         
         // Old cell value should not have been overwritten
-        assertNotEquals(CellType.BLANK, destCell.getCellType());
-        assertEquals(CellType.BOOLEAN, destCell.getCellType());
+        assertNotEquals(CellType.BLANK, destCell.getCellTypeEnum());
+        assertEquals(CellType.BOOLEAN, destCell.getCellTypeEnum());
         assertEquals(true, destCell.getBooleanCellValue());
     }
     
index 28cc7f79a3f2ca53a8e25ba17d5e69a35a0ee3ed..566944d18db4583179247638b1d152ec0d60b39e 100644 (file)
@@ -576,9 +576,9 @@ public final class TestXSSFFormulaEvaluation extends BaseTestFormulaEvaluator {
 
         wb.getCreationHelper().createFormulaEvaluator().evaluateAll();
 
-        assertEquals(CellType.ERROR, getCell(sheet, 0,0).getCachedFormulaResultType());
+        assertEquals(CellType.ERROR, getCell(sheet, 0,0).getCachedFormulaResultTypeEnum());
         assertEquals(FormulaError.VALUE.getCode(), getCell(sheet, 0,0).getErrorCellValue());
-        assertEquals(CellType.ERROR, getCell(sheet, 0,1).getCachedFormulaResultType());
+        assertEquals(CellType.ERROR, getCell(sheet, 0,1).getCachedFormulaResultTypeEnum());
         assertEquals(FormulaError.VALUE.getCode(), getCell(sheet, 0,1).getErrorCellValue());
         
         wb.close();
@@ -597,11 +597,11 @@ public final class TestXSSFFormulaEvaluation extends BaseTestFormulaEvaluator {
 
         wb.getCreationHelper().createFormulaEvaluator().evaluateAll();
 
-        assertEquals(CellType.ERROR, getCell(sheet, 0, 0).getCachedFormulaResultType());
+        assertEquals(CellType.ERROR, getCell(sheet, 0, 0).getCachedFormulaResultTypeEnum());
         assertEquals(FormulaError.VALUE.getCode(), getCell(sheet, 0, 0).getErrorCellValue());
-        assertEquals(CellType.ERROR, getCell(sheet, 1, 0).getCachedFormulaResultType());
+        assertEquals(CellType.ERROR, getCell(sheet, 1, 0).getCachedFormulaResultTypeEnum());
         assertEquals(FormulaError.VALUE.getCode(), getCell(sheet, 1, 0).getErrorCellValue());
-        assertEquals(CellType.ERROR, getCell(sheet, 0, 3).getCachedFormulaResultType());
+        assertEquals(CellType.ERROR, getCell(sheet, 0, 3).getCachedFormulaResultTypeEnum());
         assertEquals(FormulaError.VALUE.getCode(), getCell(sheet, 0, 3).getErrorCellValue());
         
         wb.close();
index 6a02c5162f0bf8430dafaeba134316c5f982c407..38dc38b7ed5207b53cc7e066dc56009ff9df16c5 100644 (file)
@@ -486,7 +486,7 @@ public final class TestXSSFFormulaParser {
 
             for (Row row : xsheet) {
                 for (Cell cell : row) {
-                    if (cell.getCellType() == CellType.FORMULA) {
+                    if (cell.getCellTypeEnum() == CellType.FORMULA) {
                         try {
                             evaluator.evaluateFormulaCell(cell);
                         } catch (Exception e) {
index fd815e9e03186154573c366dd1e01ad36cacb1af..55fe4a4fa57da5de3ce75d328a56facf8803c2d1 100644 (file)
@@ -317,7 +317,7 @@ public class TestXSSFPivotTable extends TestCase {
      */
     public void testAddDataColumnWithOffsetData() {
         offsetPivotTable.addColumnLabel(DataConsolidateFunction.SUM, 1);
-        assertEquals(CellType.NUMERIC, offsetOuterCell.getCellType());
+        assertEquals(CellType.NUMERIC, offsetOuterCell.getCellTypeEnum());
         
         offsetPivotTable.addColumnLabel(DataConsolidateFunction.SUM, 0);
     }
index 9db9171e1e0eef27dd89439b02ccafac425cf45e..6b49d81c984e6ca84c2cc7acdd14bff95fb3b767 100644 (file)
@@ -183,7 +183,7 @@ public final class TestXSSFRow extends BaseTestXRow {
         assertSame("existing references to externObserverRow are still valid", externObserverRow, sheet2.getRow(0));
         
         // Make sure copyRowFrom actually copied row (this is tested elsewhere)
-        assertEquals(CellType.STRING, destRow.getCell(0).getCellType());
+        assertEquals(CellType.STRING, destRow.getCell(0).getCellTypeEnum());
         assertEquals("hello", destRow.getCell(0).getStringCellValue());
         
         // We don't want #REF! errors if we copy a row that contains cells that are referred to by other cells outside of copied region
index f8681fd002fd733baf2b7c8bcebd364dabd701d3..a9b0d1f0b5b4c28cba2e4bcec37c0f47c26270d6 100644 (file)
@@ -1484,44 +1484,44 @@ public final class TestXSSFSheet extends BaseTestXSheet {
 
         // Blank
         cell = CellUtil.getCell(destRow, col++);
-        assertEquals("[Blank] C7 cell type", CellType.BLANK, cell.getCellType());
+        assertEquals("[Blank] C7 cell type", CellType.BLANK, cell.getCellTypeEnum());
 
         // Error
         cell = CellUtil.getCell(destRow, col++);
-        assertEquals("[Error] D7 cell type", CellType.ERROR, cell.getCellType());
+        assertEquals("[Error] D7 cell type", CellType.ERROR, cell.getCellTypeEnum());
         final FormulaError error = FormulaError.forInt(cell.getErrorCellValue());
         assertEquals("[Error] D7 cell value", FormulaError.NA, error); //FIXME: XSSFCell and HSSFCell expose different interfaces. getErrorCellString would be helpful here
 
         // Date
         cell = CellUtil.getCell(destRow, col++);
-        assertEquals("[Date] E7 cell type", CellType.NUMERIC, cell.getCellType());
+        assertEquals("[Date] E7 cell type", CellType.NUMERIC, cell.getCellTypeEnum());
         final Date date = LocaleUtil.getLocaleCalendar(2000, Calendar.JANUARY, 1).getTime();
         assertEquals("[Date] E7 cell value", date, cell.getDateCellValue());
 
         // Boolean
         cell = CellUtil.getCell(destRow, col++);
-        assertEquals("[Boolean] F7 cell type", CellType.BOOLEAN, cell.getCellType());
+        assertEquals("[Boolean] F7 cell type", CellType.BOOLEAN, cell.getCellTypeEnum());
         assertEquals("[Boolean] F7 cell value", true, cell.getBooleanCellValue());
 
         // String
         cell = CellUtil.getCell(destRow, col++);
-        assertEquals("[String] G7 cell type", CellType.STRING, cell.getCellType());
+        assertEquals("[String] G7 cell type", CellType.STRING, cell.getCellTypeEnum());
         assertEquals("[String] G7 cell value", "Hello", cell.getStringCellValue());
         
         // Int
         cell = CellUtil.getCell(destRow, col++);
-        assertEquals("[Int] H7 cell type", CellType.NUMERIC, cell.getCellType());
+        assertEquals("[Int] H7 cell type", CellType.NUMERIC, cell.getCellTypeEnum());
         assertEquals("[Int] H7 cell value", 15, (int) cell.getNumericCellValue());
         
         // Float
         cell = CellUtil.getCell(destRow, col++);
-        assertEquals("[Float] I7 cell type", CellType.NUMERIC, cell.getCellType());
+        assertEquals("[Float] I7 cell type", CellType.NUMERIC, cell.getCellTypeEnum());
         assertEquals("[Float] I7 cell value", 12.5, cell.getNumericCellValue(), FLOAT_PRECISION);
         
         // Cell Formula
         cell = CellUtil.getCell(destRow, col++);
         assertEquals("J7", new CellReference(cell).formatAsString());
-        assertEquals("[Cell Formula] J7 cell type", CellType.FORMULA, cell.getCellType());
+        assertEquals("[Cell Formula] J7 cell type", CellType.FORMULA, cell.getCellTypeEnum());
         assertEquals("[Cell Formula] J7 cell formula", "5+2", cell.getCellFormula());
         System.out.println("Cell formula evaluation currently unsupported");
         
@@ -1530,21 +1530,21 @@ public final class TestXSSFSheet extends BaseTestXSheet {
         cell = CellUtil.getCell(destRow, col++);
         assertEquals("K7", new CellReference(cell).formatAsString());
         assertEquals("[Cell Formula with Reference] K7 cell type",
-                CellType.FORMULA, cell.getCellType());
+                CellType.FORMULA, cell.getCellTypeEnum());
         assertEquals("[Cell Formula with Reference] K7 cell formula",
                 "J7+H$2", cell.getCellFormula());
         
         // Cell Formula with Reference spanning multiple rows
         cell = CellUtil.getCell(destRow, col++);
         assertEquals("[Cell Formula with Reference spanning multiple rows] L7 cell type",
-                CellType.FORMULA, cell.getCellType());
+                CellType.FORMULA, cell.getCellTypeEnum());
         assertEquals("[Cell Formula with Reference spanning multiple rows] L7 cell formula",
                 "G7&\" \"&G8", cell.getCellFormula());
         
         // Cell Formula with Reference spanning multiple rows
         cell = CellUtil.getCell(destRow, col++);
         assertEquals("[Cell Formula with Area Reference] M7 cell type",
-                CellType.FORMULA, cell.getCellType());
+                CellType.FORMULA, cell.getCellTypeEnum());
         assertEquals("[Cell Formula with Area Reference] M7 cell formula",
                 "SUM(H7:I8)", cell.getCellFormula());
         
@@ -1559,7 +1559,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
         
         // Data Format
         cell = CellUtil.getCell(destRow, col++);
-        assertEquals("[Data Format] O7 cell type;", CellType.NUMERIC, cell.getCellType());
+        assertEquals("[Data Format] O7 cell type;", CellType.NUMERIC, cell.getCellTypeEnum());
         assertEquals("[Data Format] O7 cell value", 100.20, cell.getNumericCellValue(), FLOAT_PRECISION);
         //FIXME: currently fails
         final String moneyFormat = "\"$\"#,##0.00_);[Red]\\(\"$\"#,##0.00\\)";
@@ -1638,83 +1638,83 @@ public final class TestXSSFSheet extends BaseTestXSheet {
         // Blank
         col++;
         cell = CellUtil.getCell(destRow1, col);
-        assertEquals("[Blank] C10 cell type", CellType.BLANK, cell.getCellType());
+        assertEquals("[Blank] C10 cell type", CellType.BLANK, cell.getCellTypeEnum());
         
         cell = CellUtil.getCell(destRow2, col);
-        assertEquals("[Blank] C11 cell type", CellType.BLANK, cell.getCellType());
+        assertEquals("[Blank] C11 cell type", CellType.BLANK, cell.getCellTypeEnum());
         
         // Error
         col++;
         cell = CellUtil.getCell(destRow1, col);
-        assertEquals("[Error] D10 cell type", CellType.ERROR, cell.getCellType());
+        assertEquals("[Error] D10 cell type", CellType.ERROR, cell.getCellTypeEnum());
         FormulaError error = FormulaError.forInt(cell.getErrorCellValue());
         assertEquals("[Error] D10 cell value", FormulaError.NA, error); //FIXME: XSSFCell and HSSFCell expose different interfaces. getErrorCellString would be helpful here
         
         cell = CellUtil.getCell(destRow2, col);
-        assertEquals("[Error] D11 cell type", CellType.ERROR, cell.getCellType());
+        assertEquals("[Error] D11 cell type", CellType.ERROR, cell.getCellTypeEnum());
         error = FormulaError.forInt(cell.getErrorCellValue());
         assertEquals("[Error] D11 cell value", FormulaError.NAME, error); //FIXME: XSSFCell and HSSFCell expose different interfaces. getErrorCellString would be helpful here
         
         // Date
         col++;
         cell = CellUtil.getCell(destRow1, col);
-        assertEquals("[Date] E10 cell type", CellType.NUMERIC, cell.getCellType());
+        assertEquals("[Date] E10 cell type", CellType.NUMERIC, cell.getCellTypeEnum());
         Date date = LocaleUtil.getLocaleCalendar(2000, Calendar.JANUARY, 1).getTime();
         assertEquals("[Date] E10 cell value", date, cell.getDateCellValue());
         
         cell = CellUtil.getCell(destRow2, col);
-        assertEquals("[Date] E11 cell type", CellType.NUMERIC, cell.getCellType());
+        assertEquals("[Date] E11 cell type", CellType.NUMERIC, cell.getCellTypeEnum());
         date = LocaleUtil.getLocaleCalendar(2000, Calendar.JANUARY, 2).getTime();
         assertEquals("[Date] E11 cell value", date, cell.getDateCellValue());
         
         // Boolean
         col++;
         cell = CellUtil.getCell(destRow1, col);
-        assertEquals("[Boolean] F10 cell type", CellType.BOOLEAN, cell.getCellType());
+        assertEquals("[Boolean] F10 cell type", CellType.BOOLEAN, cell.getCellTypeEnum());
         assertEquals("[Boolean] F10 cell value", true, cell.getBooleanCellValue());
         
         cell = CellUtil.getCell(destRow2, col);
-        assertEquals("[Boolean] F11 cell type", CellType.BOOLEAN, cell.getCellType());
+        assertEquals("[Boolean] F11 cell type", CellType.BOOLEAN, cell.getCellTypeEnum());
         assertEquals("[Boolean] F11 cell value", false, cell.getBooleanCellValue());
         
         // String
         col++;
         cell = CellUtil.getCell(destRow1, col);
-        assertEquals("[String] G10 cell type", CellType.STRING, cell.getCellType());
+        assertEquals("[String] G10 cell type", CellType.STRING, cell.getCellTypeEnum());
         assertEquals("[String] G10 cell value", "Hello", cell.getStringCellValue());
         
         cell = CellUtil.getCell(destRow2, col);
-        assertEquals("[String] G11 cell type", CellType.STRING, cell.getCellType());
+        assertEquals("[String] G11 cell type", CellType.STRING, cell.getCellTypeEnum());
         assertEquals("[String] G11 cell value", "World", cell.getStringCellValue());
         
         // Int
         col++;
         cell = CellUtil.getCell(destRow1, col);
-        assertEquals("[Int] H10 cell type", CellType.NUMERIC, cell.getCellType());
+        assertEquals("[Int] H10 cell type", CellType.NUMERIC, cell.getCellTypeEnum());
         assertEquals("[Int] H10 cell value", 15, (int) cell.getNumericCellValue());
         
         cell = CellUtil.getCell(destRow2, col);
-        assertEquals("[Int] H11 cell type", CellType.NUMERIC, cell.getCellType());
+        assertEquals("[Int] H11 cell type", CellType.NUMERIC, cell.getCellTypeEnum());
         assertEquals("[Int] H11 cell value", 42, (int) cell.getNumericCellValue());
         
         // Float
         col++;
         cell = CellUtil.getCell(destRow1, col);
-        assertEquals("[Float] I10 cell type", CellType.NUMERIC, cell.getCellType());
+        assertEquals("[Float] I10 cell type", CellType.NUMERIC, cell.getCellTypeEnum());
         assertEquals("[Float] I10 cell value", 12.5, cell.getNumericCellValue(), FLOAT_PRECISION);
         
         cell = CellUtil.getCell(destRow2, col);
-        assertEquals("[Float] I11 cell type", CellType.NUMERIC, cell.getCellType());
+        assertEquals("[Float] I11 cell type", CellType.NUMERIC, cell.getCellTypeEnum());
         assertEquals("[Float] I11 cell value", 5.5, cell.getNumericCellValue(), FLOAT_PRECISION);
         
         // Cell Formula
         col++;
         cell = CellUtil.getCell(destRow1, col);
-        assertEquals("[Cell Formula] J10 cell type", CellType.FORMULA, cell.getCellType());
+        assertEquals("[Cell Formula] J10 cell type", CellType.FORMULA, cell.getCellTypeEnum());
         assertEquals("[Cell Formula] J10 cell formula", "5+2", cell.getCellFormula());
         
         cell = CellUtil.getCell(destRow2, col);
-        assertEquals("[Cell Formula] J11 cell type", CellType.FORMULA, cell.getCellType());
+        assertEquals("[Cell Formula] J11 cell type", CellType.FORMULA, cell.getCellTypeEnum());
         assertEquals("[Cell Formula] J11 cell formula", "6+18", cell.getCellFormula());
 
         // Cell Formula with Reference
@@ -1722,25 +1722,25 @@ public final class TestXSSFSheet extends BaseTestXSheet {
         // Formula row references should be adjusted by destRowNum-srcRowNum
         cell = CellUtil.getCell(destRow1, col);
         assertEquals("[Cell Formula with Reference] K10 cell type",
-                CellType.FORMULA, cell.getCellType());
+                CellType.FORMULA, cell.getCellTypeEnum());
         assertEquals("[Cell Formula with Reference] K10 cell formula",
                 "J10+H$2", cell.getCellFormula());
         
         cell = CellUtil.getCell(destRow2, col);
-        assertEquals("[Cell Formula with Reference] K11 cell type", CellType.FORMULA, cell.getCellType());
+        assertEquals("[Cell Formula with Reference] K11 cell type", CellType.FORMULA, cell.getCellTypeEnum());
         assertEquals("[Cell Formula with Reference] K11 cell formula", "J11+H$2", cell.getCellFormula());
         
         // Cell Formula with Reference spanning multiple rows
         col++;
         cell = CellUtil.getCell(destRow1, col);
         assertEquals("[Cell Formula with Reference spanning multiple rows] L10 cell type",
-                CellType.FORMULA, cell.getCellType());
+                CellType.FORMULA, cell.getCellTypeEnum());
         assertEquals("[Cell Formula with Reference spanning multiple rows] L10 cell formula",
                 "G10&\" \"&G11", cell.getCellFormula());
         
         cell = CellUtil.getCell(destRow2, col);
         assertEquals("[Cell Formula with Reference spanning multiple rows] L11 cell type",
-                CellType.FORMULA, cell.getCellType());
+                CellType.FORMULA, cell.getCellTypeEnum());
         assertEquals("[Cell Formula with Reference spanning multiple rows] L11 cell formula",
                 "G11&\" \"&G12", cell.getCellFormula());
         
@@ -1748,13 +1748,13 @@ public final class TestXSSFSheet extends BaseTestXSheet {
         col++;
         cell = CellUtil.getCell(destRow1, col);
         assertEquals("[Cell Formula with Area Reference] M10 cell type",
-                CellType.FORMULA, cell.getCellType());
+                CellType.FORMULA, cell.getCellTypeEnum());
         assertEquals("[Cell Formula with Area Reference] M10 cell formula",
                 "SUM(H10:I11)", cell.getCellFormula());
         
         cell = CellUtil.getCell(destRow2, col);
         assertEquals("[Cell Formula with Area Reference] M11 cell type",
-                CellType.FORMULA, cell.getCellType());
+                CellType.FORMULA, cell.getCellTypeEnum());
         assertEquals("[Cell Formula with Area Reference] M11 cell formula",
                 "SUM($H$3:I10)", cell.getCellFormula()); //Also acceptable: SUM($H10:I$3), but this AreaReference isn't in ascending order
         
@@ -1776,7 +1776,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
         // Data Format
         col++;
         cell = CellUtil.getCell(destRow2, col);
-        assertEquals("[Data Format] O10 cell type", CellType.NUMERIC, cell.getCellType());
+        assertEquals("[Data Format] O10 cell type", CellType.NUMERIC, cell.getCellTypeEnum());
         assertEquals("[Data Format] O10 cell value", 100.20, cell.getNumericCellValue(), FLOAT_PRECISION);
         final String moneyFormat = "\"$\"#,##0.00_);[Red]\\(\"$\"#,##0.00\\)";
         assertEquals("[Data Format] O10 cell data format", moneyFormat, cell.getCellStyle().getDataFormatString());
index 24f9e37b29ecea72df6d376788ef8638d4cc5e94..8e508860a003c93d09598c9393260aeba9e09a3f 100644 (file)
@@ -117,7 +117,7 @@ public final class TestXSSFSheetShiftRows extends BaseTestSheetShiftRows {
             return;
         }
         Cell readCell = readRow.getCell(0);
-        if(readCell.getCellType() == CellType.NUMERIC) {
+        if(readCell.getCellTypeEnum() == CellType.NUMERIC) {
             assertEquals(expect, Double.toString(readCell.getNumericCellValue()));
         } else {
             assertEquals(expect, readCell.getStringCellValue());
index 62f3d142312de733d6a0c2b0c5d305e105793ffa..a3d1624111467601bfd5dae2ac7284b2ad30cf16 100644 (file)
@@ -121,14 +121,14 @@ public abstract class AbstractExcelConverter
     protected boolean isTextEmpty( HSSFCell cell )
     {
         final String value;
-        switch ( cell.getCellType() )
+        switch ( cell.getCellTypeEnum() )
         {
         case STRING:
             // XXX: enrich
             value = cell.getRichStringCellValue().getString();
             break;
         case FORMULA:
-            switch ( cell.getCachedFormulaResultType() )
+            switch ( cell.getCachedFormulaResultTypeEnum() )
             {
             case STRING:
                 HSSFRichTextString str = cell.getRichStringCellValue();
index 7119718964dac4d0ede8865b1f0c0f325a17bc84..1c32edabe87d59704d049c0b9caf0da7e89c220a 100644 (file)
@@ -207,14 +207,14 @@ public class ExcelToFoConverter extends AbstractExcelConverter
         final HSSFCellStyle cellStyle = cell.getCellStyle();
 
         String value;
-        switch ( cell.getCellType() )
+        switch ( cell.getCellTypeEnum() )
         {
         case STRING:
             // XXX: enrich
             value = cell.getRichStringCellValue().getString();
             break;
         case FORMULA:
-            switch ( cell.getCachedFormulaResultType() )
+            switch ( cell.getCachedFormulaResultTypeEnum() )
             {
             case STRING:
                 HSSFRichTextString str = cell.getRichStringCellValue();
@@ -243,7 +243,7 @@ public class ExcelToFoConverter extends AbstractExcelConverter
                 logger.log(
                         POILogger.WARN,
                         "Unexpected cell cachedFormulaResultType ("
-                                + cell.getCachedFormulaResultType() + ")" );
+                                + cell.getCachedFormulaResultTypeEnum() + ")" );
                 value = ExcelToHtmlUtils.EMPTY;
                 break;
             }
@@ -262,7 +262,7 @@ public class ExcelToFoConverter extends AbstractExcelConverter
             break;
         default:
             logger.log( POILogger.WARN,
-                    "Unexpected cell type (" + cell.getCellType() + ")" );
+                    "Unexpected cell type (" + cell.getCellTypeEnum() + ")" );
             return true;
         }
 
index b34b2ed8e3c19d323c5e2c5ec0fe6c629e33cdef..54dc4d3196ea65f4b259138dc09ce070582c5c97 100644 (file)
@@ -294,14 +294,14 @@ public class ExcelToHtmlConverter extends AbstractExcelConverter
         final HSSFCellStyle cellStyle = cell.getCellStyle();
 
         String value;
-        switch ( cell.getCellType() )
+        switch ( cell.getCellTypeEnum() )
         {
         case STRING:
             // XXX: enrich
             value = cell.getRichStringCellValue().getString();
             break;
         case FORMULA:
-            switch ( cell.getCachedFormulaResultType() )
+            switch ( cell.getCachedFormulaResultTypeEnum() )
             {
             case STRING:
                 HSSFRichTextString str = cell.getRichStringCellValue();
@@ -330,7 +330,7 @@ public class ExcelToHtmlConverter extends AbstractExcelConverter
                 logger.log(
                         POILogger.WARN,
                         "Unexpected cell cachedFormulaResultType ("
-                                + cell.getCachedFormulaResultType() + ")" );
+                                + cell.getCachedFormulaResultTypeEnum() + ")" );
                 value = ExcelToHtmlUtils.EMPTY;
                 break;
             }
@@ -349,7 +349,7 @@ public class ExcelToHtmlConverter extends AbstractExcelConverter
             break;
         default:
             logger.log( POILogger.WARN,
-                    "Unexpected cell type (" + cell.getCellType() + ")" );
+                    "Unexpected cell type (" + cell.getCellTypeEnum() + ")" );
             return true;
         }
 
index 48d0066cf00090c432ec40a092981492768adc0f..4869d87d6177ecec990cf369eb4ff4af0396ead4 100644 (file)
@@ -80,7 +80,7 @@ public final class TestRVA {
                 break;
             }
             HSSFCell cell = row.getCell(0);
-            if (cell == null || cell.getCellType() == CellType.BLANK) {
+            if (cell == null || cell.getCellTypeEnum() == CellType.BLANK) {
                 break;
             }
 
index f0f95261a7ddacdc79925d0dce17648b8063f343..cbfc6d9b88177ef92b9ea818747c85522b07113f 100644 (file)
@@ -68,7 +68,7 @@ public final class TestBug42464 {
                Iterator<Cell> it = row.cellIterator();
                while(it.hasNext()) {
                        HSSFCell cell = (HSSFCell)it.next();
-                       if(cell.getCellType() != CellType.FORMULA) {
+                       if(cell.getCellTypeEnum() != CellType.FORMULA) {
                            continue;
                        }
                        FormulaRecordAggregate record = (FormulaRecordAggregate) cell.getCellValueRecord();
index d588115b657b6e95fdc570689c44c45a611f5994..1d450a2e041e571f814c7140f24c0321b8f497a9 100644 (file)
@@ -469,7 +469,7 @@ public final class TestBugs extends BaseTestBugzillaIssues {
             HSSFRow row =  sheet.getRow(i);
             if (row != null) {
                 HSSFCell cell = row .getCell(0);
-                assertEquals(CellType.STRING, cell.getCellType());
+                assertEquals(CellType.STRING, cell.getCellTypeEnum());
                 count++;
             }
         }
@@ -1167,13 +1167,13 @@ public final class TestBugs extends BaseTestBugzillaIssues {
     }
 
     private static void confirmCachedValue(double expectedValue, HSSFCell cell) {
-        assertEquals(CellType.FORMULA, cell.getCellType());
-        assertEquals(CellType.NUMERIC, cell.getCachedFormulaResultType());
+        assertEquals(CellType.FORMULA, cell.getCellTypeEnum());
+        assertEquals(CellType.NUMERIC, cell.getCachedFormulaResultTypeEnum());
         assertEquals(expectedValue, cell.getNumericCellValue(), 0.0);
     }
     private static void confirmCachedValue(String expectedValue, HSSFCell cell) {
-        assertEquals(CellType.FORMULA, cell.getCellType());
-        assertEquals(CellType.STRING, cell.getCachedFormulaResultType());
+        assertEquals(CellType.FORMULA, cell.getCellTypeEnum());
+        assertEquals(CellType.STRING, cell.getCachedFormulaResultTypeEnum());
         assertEquals(expectedValue, cell.getRichStringCellValue().getString());
     }
 
@@ -1288,7 +1288,7 @@ public final class TestBugs extends BaseTestBugzillaIssues {
         s = wb.getSheet("OneVariable Table Completed");
         r = s.getRow(3);
         c = r.getCell(4);
-        assertEquals(CellType.FORMULA, c.getCellType());
+        assertEquals(CellType.FORMULA, c.getCellTypeEnum());
 
         // TODO - check the formula once tables and
         //  arrays are properly supported
@@ -1298,7 +1298,7 @@ public final class TestBugs extends BaseTestBugzillaIssues {
         s = wb.getSheet("TwoVariable Table Example");
         r = s.getRow(3);
         c = r.getCell(4);
-        assertEquals(CellType.FORMULA, c.getCellType());
+        assertEquals(CellType.FORMULA, c.getCellTypeEnum());
 
         // TODO - check the formula once tables and
         //  arrays are properly supported
@@ -1824,26 +1824,26 @@ public final class TestBugs extends BaseTestBugzillaIssues {
        HSSFRow row;
 
        row = s.getRow(0);
-       assertEquals(CellType.NUMERIC, row.getCell(1).getCellType());
+       assertEquals(CellType.NUMERIC, row.getCell(1).getCellTypeEnum());
        assertEquals(112.0, row.getCell(1).getNumericCellValue(), 0);
 
        row = s.getRow(1);
-       assertEquals(CellType.FORMULA, row.getCell(1).getCellType());
+       assertEquals(CellType.FORMULA, row.getCell(1).getCellTypeEnum());
        assertEquals("B1", row.getCell(1).getCellFormula());
        assertEquals(112.0, row.getCell(1).getNumericCellValue(), 0);
 
        row = s.getRow(2);
-       assertEquals(CellType.FORMULA, row.getCell(1).getCellType());
+       assertEquals(CellType.FORMULA, row.getCell(1).getCellTypeEnum());
        assertEquals("Sheet1!B1", row.getCell(1).getCellFormula());
        assertEquals(112.0, row.getCell(1).getNumericCellValue(), 0);
 
        row = s.getRow(3);
-       assertEquals(CellType.FORMULA, row.getCell(1).getCellType());
+       assertEquals(CellType.FORMULA, row.getCell(1).getCellTypeEnum());
        assertEquals("[Formulas2.xls]Sheet1!B2", row.getCell(1).getCellFormula());
        assertEquals(112.0, row.getCell(1).getNumericCellValue(), 0);
 
        row = s.getRow(4);
-       assertEquals(CellType.FORMULA, row.getCell(1).getCellType());
+       assertEquals(CellType.FORMULA, row.getCell(1).getCellTypeEnum());
        assertEquals("'[$http://gagravarr.org/FormulaRefs.xls]Sheet1'!B1", row.getCell(1).getCellFormula());
        assertEquals(112.0, row.getCell(1).getNumericCellValue(), 0);
 
@@ -1864,21 +1864,21 @@ public final class TestBugs extends BaseTestBugzillaIssues {
        s = wb2.getSheetAt(0);
 
        row = s.getRow(0);
-       assertEquals(CellType.NUMERIC, row.getCell(1).getCellType());
+       assertEquals(CellType.NUMERIC, row.getCell(1).getCellTypeEnum());
        assertEquals(112.0, row.getCell(1).getNumericCellValue(),0);
 
        row = s.getRow(1);
-       assertEquals(CellType.FORMULA, row.getCell(1).getCellType());
+       assertEquals(CellType.FORMULA, row.getCell(1).getCellTypeEnum());
        assertEquals("B1", row.getCell(1).getCellFormula());
        assertEquals(112.0, row.getCell(1).getNumericCellValue(), 0);
 
        row = s.getRow(2);
-       assertEquals(CellType.FORMULA, row.getCell(1).getCellType());
+       assertEquals(CellType.FORMULA, row.getCell(1).getCellTypeEnum());
        assertEquals("Sheet1!B1", row.getCell(1).getCellFormula());
        assertEquals(112.0, row.getCell(1).getNumericCellValue(), 0);
 
        row = s.getRow(3);
-       assertEquals(CellType.FORMULA, row.getCell(1).getCellType());
+       assertEquals(CellType.FORMULA, row.getCell(1).getCellTypeEnum());
        assertEquals("[Formulas2.xls]Sheet1!B2", row.getCell(1).getCellFormula());
        assertEquals(112.0, row.getCell(1).getNumericCellValue(), 0);
 
@@ -2755,13 +2755,13 @@ public final class TestBugs extends BaseTestBugzillaIssues {
     }
     
     private void assertFormula(Workbook wb, Cell intF, String expectedFormula, String expectedResultOrNull) {
-        assertEquals(CellType.FORMULA, intF.getCellType());
+        assertEquals(CellType.FORMULA, intF.getCellTypeEnum());
         if (null == expectedResultOrNull) {
-            assertEquals(CellType.ERROR, intF.getCachedFormulaResultType());
+            assertEquals(CellType.ERROR, intF.getCachedFormulaResultTypeEnum());
             expectedResultOrNull = "#VALUE!";
         }
         else {
-            assertEquals(CellType.NUMERIC, intF.getCachedFormulaResultType());
+            assertEquals(CellType.NUMERIC, intF.getCachedFormulaResultTypeEnum());
         }
         
         assertEquals(expectedFormula, intF.getCellFormula());
@@ -2987,12 +2987,12 @@ public final class TestBugs extends BaseTestBugzillaIssues {
         Sheet sheet = wb.getSheetAt(0);
         Row row = sheet.getRow(0);
         Cell cell = row.getCell(0);
-        assertEquals(CellType.FORMULA, cell.getCellType());
+        assertEquals(CellType.FORMULA, cell.getCellTypeEnum());
         assertEquals("IF(TRUE,\"\",\"\")", cell.getCellFormula());
         assertEquals("", cell.getStringCellValue());
         cell.setCellType(CellType.STRING);
 
-        assertEquals(CellType.BLANK, cell.getCellType());
+        assertEquals(CellType.BLANK, cell.getCellTypeEnum());
         try {
             assertNull(cell.getCellFormula());
             fail("Should throw an exception here");
index e5aad2afc4d61e81e1d4355e01b1451fed11bd5f..7e6d8a3bcfe443047c0c706dc4f79c9ee13cc430 100644 (file)
@@ -436,7 +436,7 @@ public final class TestCellStyle extends TestCase {
         
                             Cell cell = row.getCell(idxCell);
                             cell.getCellStyle().getDataFormatString();
-                            if (cell.getCellType() == CellType.NUMERIC) {
+                            if (cell.getCellTypeEnum() == CellType.NUMERIC) {
                                 boolean isDate = HSSFDateUtil.isCellDateFormatted(cell);
                                 if (idxCell > 0 && isDate) {
                                     fail("cell " + idxCell + " is not a date: " + idxCell.toString());
index 86d59d8c7429e6885847c0c8cac7e5225898aa16..9e3d4c33a5fd7e925f31719a22fed5d047fe7aee 100644 (file)
@@ -51,7 +51,7 @@ public class TestExternalReferenceChange extends TestCase {
                HSSFSheet lSheet = mainWorkbook.getSheetAt(0);
                HSSFCell lA1Cell = lSheet.getRow(0).getCell(0);
                
-               assertEquals(CellType.FORMULA, lA1Cell.getCellType());
+               assertEquals(CellType.FORMULA, lA1Cell.getCellTypeEnum());
                
                HSSFFormulaEvaluator lMainWorkbookEvaluator = new HSSFFormulaEvaluator(mainWorkbook);
                HSSFFormulaEvaluator lSourceEvaluator = new HSSFFormulaEvaluator(sourceWorkbook);
index 82124ffc803bb2cb3580367bc35bf18c7be76b30..d1a3333663058416569cee79b4dc18df1ebe2b76 100644 (file)
@@ -566,7 +566,7 @@ public final class TestFormulaEvaluatorBugs {
         }
     }
     private Ptg[] getPtgs(HSSFCell cell) {
-        assertEquals(CellType.FORMULA, cell.getCellType());
+        assertEquals(CellType.FORMULA, cell.getCellTypeEnum());
         assertEquals(FormulaRecordAggregate.class, cell.getCellValueRecord().getClass());
         FormulaRecordAggregate agg = (FormulaRecordAggregate)cell.getCellValueRecord();
         FormulaRecord rec = agg.getFormulaRecord();
index 902884653d6f0b50da57df1d82e413bee141ec90..1e30e7eb86e1e418c33a9ad92af493990aa30a55 100644 (file)
@@ -77,7 +77,7 @@ public final class TestFormulaEvaluatorDocs extends TestCase {
 
                                for(Iterator cit = r.cellIterator(); cit.hasNext();) {
                                        HSSFCell c = (HSSFCell)cit.next();
-                                       if(c.getCellType() == CellType.FORMULA) {
+                                       if(c.getCellTypeEnum() == CellType.FORMULA) {
                                                evaluator.evaluateFormulaCell(c);
                                                
                                                // For testing - all should be numeric
@@ -90,15 +90,15 @@ public final class TestFormulaEvaluatorDocs extends TestCase {
                // Check now as expected
                assertEquals(55.7, wb.getSheetAt(0).getRow(0).getCell(2).getNumericCellValue(), 0);
                assertEquals("SUM(A1:B1)", wb.getSheetAt(0).getRow(0).getCell(2).getCellFormula());
-               assertEquals(CellType.FORMULA, wb.getSheetAt(0).getRow(0).getCell(2).getCellType());
+               assertEquals(CellType.FORMULA, wb.getSheetAt(0).getRow(0).getCell(2).getCellTypeEnum());
                
                assertEquals(-4.6, wb.getSheetAt(0).getRow(1).getCell(2).getNumericCellValue(), 0);
                assertEquals("SUM(A2:B2)", wb.getSheetAt(0).getRow(1).getCell(2).getCellFormula());
-               assertEquals(CellType.FORMULA, wb.getSheetAt(0).getRow(1).getCell(2).getCellType());
+               assertEquals(CellType.FORMULA, wb.getSheetAt(0).getRow(1).getCell(2).getCellTypeEnum());
                
                assertEquals(22.3, wb.getSheetAt(1).getRow(0).getCell(0).getNumericCellValue(), 0);
                assertEquals("'S1'!A1", wb.getSheetAt(1).getRow(0).getCell(0).getCellFormula());
-               assertEquals(CellType.FORMULA, wb.getSheetAt(1).getRow(0).getCell(0).getCellType());
+               assertEquals(CellType.FORMULA, wb.getSheetAt(1).getRow(0).getCell(0).getCellTypeEnum());
                
                
                // Now do the alternate call, which zaps the formulas
@@ -112,7 +112,7 @@ public final class TestFormulaEvaluatorDocs extends TestCase {
 
                                for(Iterator cit = r.cellIterator(); cit.hasNext();) {
                                        HSSFCell c = (HSSFCell)cit.next();
-                                       if(c.getCellType() == CellType.FORMULA) {
+                                       if(c.getCellTypeEnum() == CellType.FORMULA) {
                                                evaluator.evaluateInCell(c);
                                        }
                                }
@@ -120,12 +120,12 @@ public final class TestFormulaEvaluatorDocs extends TestCase {
                }
                
                assertEquals(55.7, wb.getSheetAt(0).getRow(0).getCell(2).getNumericCellValue(), 0);
-               assertEquals(CellType.NUMERIC, wb.getSheetAt(0).getRow(0).getCell(2).getCellType());
+               assertEquals(CellType.NUMERIC, wb.getSheetAt(0).getRow(0).getCell(2).getCellTypeEnum());
                
                assertEquals(-4.6, wb.getSheetAt(0).getRow(1).getCell(2).getNumericCellValue(), 0);
-               assertEquals(CellType.NUMERIC, wb.getSheetAt(0).getRow(1).getCell(2).getCellType());
+               assertEquals(CellType.NUMERIC, wb.getSheetAt(0).getRow(1).getCell(2).getCellTypeEnum());
                
                assertEquals(22.3, wb.getSheetAt(1).getRow(0).getCell(0).getNumericCellValue(), 0);
-               assertEquals(CellType.NUMERIC, wb.getSheetAt(1).getRow(0).getCell(0).getCellType());
+               assertEquals(CellType.NUMERIC, wb.getSheetAt(1).getRow(0).getCell(0).getCellTypeEnum());
        }
 }
index ed27a21f9e0496002aca4d3a70c91875da20dacb..fd3b1a66de5aa83ee2ec847e064eb7e448afbab7 100644 (file)
@@ -415,7 +415,7 @@ public final class TestHSSFCell extends BaseTestCell {
         assertEquals(wb.getWorkbook(), cell.getBoundWorkbook());
 
         try {
-            cell.getCachedFormulaResultType();
+            cell.getCachedFormulaResultTypeEnum();
             fail("Should catch exception");
         } catch (IllegalStateException e) {
             // expected here
index 69842b4d4d7e3a02370d723f05e6d00d668c78fe..50d320a966a86ec01575b3890dbec54fb406a642 100644 (file)
@@ -384,7 +384,7 @@ public final class TestHSSFDataFormatter {
         HSSFRow row = sheet.getRow(0);
         HSSFCell cellA1 = row.getCell(0);
 
-        assertEquals(CellType.NUMERIC, cellA1.getCellType());
+        assertEquals(CellType.NUMERIC, cellA1.getCellTypeEnum());
         assertEquals(2345.0, cellA1.getNumericCellValue(), 0.0001);
         assertEquals("@", cellA1.getCellStyle().getDataFormatString());
 
index 4b1e0677e0b8fe0a1a208684ab88acb9863122aa..95e6e19fc53c26771bb7bc07f5437fd1366e8462 100644 (file)
@@ -199,8 +199,8 @@ public final class TestHSSFFormulaEvaluator extends BaseTestFormulaEvaluator {
       
       // VLookup on a name in another file
       cell = wb1.getSheetAt(0).getRow(1).getCell(2);
-      assertEquals(CellType.FORMULA, cell.getCellType());
-      assertEquals(CellType.NUMERIC, cell.getCachedFormulaResultType());
+      assertEquals(CellType.FORMULA, cell.getCellTypeEnum());
+      assertEquals(CellType.NUMERIC, cell.getCachedFormulaResultTypeEnum());
       assertEquals(12.30, cell.getNumericCellValue(), 0.0001);
       // WARNING - this is wrong!
       // The file name should be showing, but bug #45970 is fixed
@@ -210,8 +210,8 @@ public final class TestHSSFFormulaEvaluator extends BaseTestFormulaEvaluator {
       
       // Simple reference to a name in another file
       cell = wb1.getSheetAt(0).getRow(1).getCell(4);
-      assertEquals(CellType.FORMULA, cell.getCellType());
-      assertEquals(CellType.NUMERIC, cell.getCachedFormulaResultType());
+      assertEquals(CellType.FORMULA, cell.getCellTypeEnum());
+      assertEquals(CellType.NUMERIC, cell.getCachedFormulaResultTypeEnum());
       assertEquals(36.90, cell.getNumericCellValue(), 0.0001);
       // TODO Correct this!
       // The file name should be shown too, see bug #56742
@@ -237,14 +237,14 @@ public final class TestHSSFFormulaEvaluator extends BaseTestFormulaEvaluator {
 
       // Re-check VLOOKUP one
       cell = wb1.getSheetAt(0).getRow(1).getCell(2);
-      assertEquals(CellType.FORMULA, cell.getCellType());
-      assertEquals(CellType.NUMERIC, cell.getCachedFormulaResultType());
+      assertEquals(CellType.FORMULA, cell.getCellTypeEnum());
+      assertEquals(CellType.NUMERIC, cell.getCachedFormulaResultTypeEnum());
       assertEquals(12.30, cell.getNumericCellValue(), 0.0001);
       
       // Re-check ref one
       cell = wb1.getSheetAt(0).getRow(1).getCell(4);
-      assertEquals(CellType.FORMULA, cell.getCellType());
-      assertEquals(CellType.NUMERIC, cell.getCachedFormulaResultType());
+      assertEquals(CellType.FORMULA, cell.getCellTypeEnum());
+      assertEquals(CellType.NUMERIC, cell.getCachedFormulaResultTypeEnum());
       assertEquals(36.90, cell.getNumericCellValue(), 0.0001);
       
       
index 405347a9bc049b35e12b1ecbac2a63c2cb09aca7..b95c576a996ccea3ccfe993d3b2907ff2675e011 100644 (file)
@@ -392,7 +392,7 @@ public final class TestWorkbook {
         HSSFSheet    s  = wb.getSheetAt(0);
         HSSFCell     c  = s.getRow(0).getCell(0);
 
-        assertEquals(CellType.NUMERIC, c.getCellType());
+        assertEquals(CellType.NUMERIC, c.getCellTypeEnum());
         
         wb.close();
     }
index 004097c822811e39da8b27787b64f993fbcba6d8..b6a9dd6994ec118789c38089c2e0a1485e9345e3 100644 (file)
@@ -67,7 +67,7 @@ public class TestMissingWorkbook extends TestCase {
                Row lARow = lSheet.getRow(0);\r
                Cell lA1Cell = lARow.getCell(0);\r
                \r
-               assertEquals(CellType.FORMULA, lA1Cell.getCellType());\r
+               assertEquals(CellType.FORMULA, lA1Cell.getCellTypeEnum());\r
                try {\r
                        evaluator.evaluateFormulaCell(lA1Cell);\r
                        fail("Missing external workbook reference exception expected!");\r
@@ -82,9 +82,9 @@ public class TestMissingWorkbook extends TestCase {
                Cell lB1Cell = lSheet.getRow(1).getCell(0);\r
                Cell lC1Cell = lSheet.getRow(2).getCell(0);\r
                \r
-               assertEquals(CellType.FORMULA, lA1Cell.getCellType());\r
-               assertEquals(CellType.FORMULA, lB1Cell.getCellType());\r
-               assertEquals(CellType.FORMULA, lC1Cell.getCellType());\r
+               assertEquals(CellType.FORMULA, lA1Cell.getCellTypeEnum());\r
+               assertEquals(CellType.FORMULA, lB1Cell.getCellTypeEnum());\r
+               assertEquals(CellType.FORMULA, lC1Cell.getCellTypeEnum());\r
 \r
                // Check cached values\r
         assertEquals(10.0d, lA1Cell.getNumericCellValue(), 0.00001d);\r
@@ -111,9 +111,9 @@ public class TestMissingWorkbook extends TestCase {
                Cell lB1Cell = lSheet.getRow(1).getCell(0);\r
                Cell lC1Cell = lSheet.getRow(2).getCell(0);\r
                \r
-               assertEquals(CellType.FORMULA, lA1Cell.getCellType());\r
-               assertEquals(CellType.FORMULA, lB1Cell.getCellType());\r
-               assertEquals(CellType.FORMULA, lC1Cell.getCellType());\r
+               assertEquals(CellType.FORMULA, lA1Cell.getCellTypeEnum());\r
+               assertEquals(CellType.FORMULA, lB1Cell.getCellTypeEnum());\r
+               assertEquals(CellType.FORMULA, lC1Cell.getCellTypeEnum());\r
 \r
                FormulaEvaluator lMainWorkbookEvaluator = mainWorkbook.getCreationHelper().createFormulaEvaluator();\r
                FormulaEvaluator lSourceEvaluator = sourceWorkbook.getCreationHelper().createFormulaEvaluator();\r
index 18f79f1a69cd59669f6b60d1e113db0e7f286662..30f7c6fd49c391c3d6628979b6d8d4d9d5d6f4fe 100644 (file)
@@ -365,7 +365,7 @@ public class TestWorkbookEvaluator {
         CellValue result = eval.evaluate(D1);
         
         // Call should not modify the contents
-        assertEquals(CellType.FORMULA, D1.getCellType());
+        assertEquals(CellType.FORMULA, D1.getCellTypeEnum());
         assertEquals(expectedFormula, D1.getCellFormula());
         
         assertEquals(CellType.NUMERIC, result.getCellType());
@@ -514,10 +514,10 @@ public class TestWorkbookEvaluator {
         CellType resultCellType = eval.evaluateFormulaCell(D1);
         
         // Call should modify the contents, but leave the formula intact
-        assertEquals(CellType.FORMULA, D1.getCellType());
+        assertEquals(CellType.FORMULA, D1.getCellTypeEnum());
         assertEquals(expectedFormula, D1.getCellFormula());
         assertEquals(CellType.NUMERIC, resultCellType);
-        assertEquals(CellType.NUMERIC, D1.getCachedFormulaResultType());
+        assertEquals(CellType.NUMERIC, D1.getCachedFormulaResultTypeEnum());
         assertEquals(expectedResult, D1.getNumericCellValue(), EPSILON);
         
         testIFEqualsFormulaEvaluation_teardown(wb);
@@ -537,7 +537,7 @@ public class TestWorkbookEvaluator {
             D1.getCellFormula();
             fail("cell formula should be overwritten with formula result");
         } catch (final IllegalStateException expected) { }
-        assertEquals(CellType.NUMERIC, D1.getCellType());
+        assertEquals(CellType.NUMERIC, D1.getCellTypeEnum());
         assertEquals(expectedResult, D1.getNumericCellValue(), EPSILON);
         
         testIFEqualsFormulaEvaluation_teardown(wb);
@@ -552,10 +552,10 @@ public class TestWorkbookEvaluator {
         eval.evaluateAll();
         
         // Call should modify the contents
-        assertEquals(CellType.FORMULA, D1.getCellType());
+        assertEquals(CellType.FORMULA, D1.getCellTypeEnum());
         assertEquals(expectedFormula, D1.getCellFormula());
         
-        assertEquals(CellType.NUMERIC, D1.getCachedFormulaResultType());
+        assertEquals(CellType.NUMERIC, D1.getCachedFormulaResultTypeEnum());
         assertEquals(expectedResult, D1.getNumericCellValue(), EPSILON);
         
         testIFEqualsFormulaEvaluation_teardown(wb);
@@ -569,11 +569,11 @@ public class TestWorkbookEvaluator {
         HSSFFormulaEvaluator.evaluateAllFormulaCells(wb);
         
         // Call should modify the contents
-        assertEquals(CellType.FORMULA, D1.getCellType());
+        assertEquals(CellType.FORMULA, D1.getCellTypeEnum());
         // whitespace gets deleted because formula is parsed and re-rendered
         assertEquals(expectedFormula, D1.getCellFormula());
         
-        assertEquals(CellType.NUMERIC, D1.getCachedFormulaResultType());
+        assertEquals(CellType.NUMERIC, D1.getCachedFormulaResultTypeEnum());
         assertEquals(expectedResult, D1.getNumericCellValue(), EPSILON);
         
         testIFEqualsFormulaEvaluation_teardown(wb);
index 802b7d8b33176c3498aa451b506c74864bb88316..1ddf81ef527ce7f0e7248e451fb1ae16dd400fe0 100644 (file)
@@ -131,7 +131,7 @@ public class TestRandBetween extends TestCase {
                formulaCell.setCellFormula("RANDBETWEEN($A$1,$B$1)");
                evaluator.clearAllCachedResultValues();
                evaluator.evaluateFormulaCell(formulaCell);
-               assertEquals(CellType.ERROR, formulaCell.getCachedFormulaResultType());
+               assertEquals(CellType.ERROR, formulaCell.getCachedFormulaResultTypeEnum());
                assertEquals(ErrorEval.VALUE_INVALID.getErrorCode(), formulaCell.getErrorCellValue());
                
                
@@ -141,7 +141,7 @@ public class TestRandBetween extends TestCase {
                formulaCell.setCellFormula("RANDBETWEEN($A$1,$B$1)");
                evaluator.clearAllCachedResultValues();
                evaluator.evaluateFormulaCell(formulaCell);
-               assertEquals(CellType.ERROR, formulaCell.getCachedFormulaResultType());
+               assertEquals(CellType.ERROR, formulaCell.getCachedFormulaResultTypeEnum());
                assertEquals(ErrorEval.VALUE_INVALID.getErrorCode(), formulaCell.getErrorCellValue());
 
                // Check case where both inputs are of wrong type
@@ -150,7 +150,7 @@ public class TestRandBetween extends TestCase {
                formulaCell.setCellFormula("RANDBETWEEN($A$1,$B$1)");
                evaluator.clearAllCachedResultValues();
                evaluator.evaluateFormulaCell(formulaCell);
-               assertEquals(CellType.ERROR, formulaCell.getCachedFormulaResultType());
+               assertEquals(CellType.ERROR, formulaCell.getCachedFormulaResultTypeEnum());
                assertEquals(ErrorEval.VALUE_INVALID.getErrorCode(), formulaCell.getErrorCellValue());
        
        }
@@ -166,14 +166,14 @@ public class TestRandBetween extends TestCase {
                formulaCell.setCellFormula("RANDBETWEEN($A$1,$B$1)");
                evaluator.clearAllCachedResultValues();
                evaluator.evaluateFormulaCell(formulaCell);
-               assertEquals(CellType.ERROR, formulaCell.getCachedFormulaResultType());
+               assertEquals(CellType.ERROR, formulaCell.getCachedFormulaResultTypeEnum());
                assertEquals(ErrorEval.NUM_ERROR.getErrorCode(), formulaCell.getErrorCellValue());              
                bottomValueCell.setCellValue(1);                
                topValueCell.setCellType(CellType.BLANK);
                formulaCell.setCellFormula("RANDBETWEEN($A$1,$B$1)");
                evaluator.clearAllCachedResultValues();
                evaluator.evaluateFormulaCell(formulaCell);
-               assertEquals(CellType.ERROR, formulaCell.getCachedFormulaResultType());
+               assertEquals(CellType.ERROR, formulaCell.getCachedFormulaResultTypeEnum());
                assertEquals(ErrorEval.NUM_ERROR.getErrorCode(), formulaCell.getErrorCellValue());
        }
        
index f52d0728e6bf4fb4815d3ea59ccbb29ff5962d9f..f683e5dbf7b4fcffbcb732a765c5798b9a8753cb 100644 (file)
@@ -63,7 +63,7 @@ public final class TestYearFracCalculatorFromSpreadsheet {
                        HSSFRow row = (HSSFRow) rowIterator.next();
                        
                        HSSFCell cell = row.getCell(SS.YEARFRAC_FORMULA_COLUMN);
-                       if (cell == null || cell.getCellType() != CellType.FORMULA) {
+                       if (cell == null || cell.getCellTypeEnum() != CellType.FORMULA) {
                                continue;
                        }
             processRow(row, cell, formulaEvaluator);
index 8457a07d94aec1319bf9b686f445e4ac5961e0d4..fb3b6a9288cb9d3fdbfd4b22240c7fd7b8a59d2a 100644 (file)
@@ -174,7 +174,7 @@ public final class TestFormulasFromSpreadsheet {
        // iterate across the row for all the evaluation cases
        for (int colnum=SS.COLUMN_INDEX_FIRST_TEST_VALUE; colnum < endcolnum; colnum++) {
            Cell c = formulasRow.getCell(colnum);
-           if (c == null || c.getCellType() != CellType.FORMULA) {
+           if (c == null || c.getCellTypeEnum() != CellType.FORMULA) {
                continue;
            }
 
@@ -187,7 +187,7 @@ public final class TestFormulasFromSpreadsheet {
            assertNotNull(msg + " - Bad setup data expected value is null", expValue);
            assertNotNull(msg + " - actual value was null", actValue);
 
-           final CellType cellType = expValue.getCellType();
+           final CellType cellType = expValue.getCellTypeEnum();
            switch (cellType) {
                case BLANK:
                    assertEquals(msg, CellType.BLANK, actValue.getCellType());
@@ -228,14 +228,14 @@ public final class TestFormulasFromSpreadsheet {
                        System.err.println("Warning - Row " + r.getRowNum() + " has no cell " + SS.COLUMN_INDEX_FUNCTION_NAME + ", can't figure out function name");
                        return null;
                }
-               if(cell.getCellType() == CellType.BLANK) {
+               if(cell.getCellTypeEnum() == CellType.BLANK) {
                        return null;
                }
-               if(cell.getCellType() == CellType.STRING) {
+               if(cell.getCellTypeEnum() == CellType.STRING) {
                        return cell.getRichStringCellValue().getString();
                }
 
                throw new AssertionFailedError("Bad cell type for 'function name' column: ("
-                               + cell.getCellType() + ") row (" + (r.getRowNum() +1) + ")");
+                               + cell.getCellTypeEnum() + ") row (" + (r.getRowNum() +1) + ")");
        }
 }
index bb9b6a85ba521831cfc74a7bdd10c85db753b257..429f5616e3a958915d62370c0c7f9d5bcd584391 100644 (file)
@@ -106,7 +106,7 @@ public final class TestMultiSheetEval extends TestCase {
                        throw new AssertionFailedError(msg + " - actual value was null");
                }
                
-               final CellType cellType = expected.getCellType();
+               final CellType cellType = expected.getCellTypeEnum();
 
                switch (cellType) {
                        case BLANK:
@@ -231,7 +231,7 @@ public final class TestMultiSheetEval extends TestCase {
                int result = Result.NO_EVALUATIONS_FOUND; // so far
 
                Cell c = formulasRow.getCell(SS.COLUMN_INDEX_ACTUAL_VALUE);
-               if (c == null || c.getCellType() != CellType.FORMULA) {
+               if (c == null || c.getCellTypeEnum() != CellType.FORMULA) {
                        return result;
                }
 
@@ -300,15 +300,15 @@ public final class TestMultiSheetEval extends TestCase {
                        System.err.println("Warning - Row " + r.getRowNum() + " has no cell " + SS.COLUMN_INDEX_FUNCTION_NAME + ", can't figure out function name");
                        return null;
                }
-               if(cell.getCellType() == CellType.BLANK) {
+               if(cell.getCellTypeEnum() == CellType.BLANK) {
                        return null;
                }
-               if(cell.getCellType() == CellType.STRING) {
+               if(cell.getCellTypeEnum() == CellType.STRING) {
                        return cell.getRichStringCellValue().getString();
                }
 
                throw new AssertionFailedError("Bad cell type for 'function name' column: ("
-                               + cell.getCellType() + ") row (" + (r.getRowNum() +1) + ")");
+                               + cell.getCellTypeEnum() + ") row (" + (r.getRowNum() +1) + ")");
        }
        /**
         * @return <code>null</code> if cell is missing, empty or blank
@@ -323,15 +323,15 @@ public final class TestMultiSheetEval extends TestCase {
                        System.err.println("Warning - Row " + r.getRowNum() + " has no cell " + SS.COLUMN_INDEX_TEST_NAME + ", can't figure out test name");
                        return null;
                }
-               if(cell.getCellType() == CellType.BLANK) {
+               if(cell.getCellTypeEnum() == CellType.BLANK) {
                        return null;
                }
-               if(cell.getCellType() == CellType.STRING) {
+               if(cell.getCellTypeEnum() == CellType.STRING) {
                        return cell.getRichStringCellValue().getString();
                }
 
                throw new AssertionFailedError("Bad cell type for 'test name' column: ("
-                               + cell.getCellType() + ") row (" + (r.getRowNum() +1) + ")");
+                               + cell.getCellTypeEnum() + ") row (" + (r.getRowNum() +1) + ")");
        }
        
 }
index 4fed4d48f9646f657f152c200fb8d51a7f33801b..8c40581e4aff4cbb52cee2c0f8122bba7c2f48e5 100644 (file)
@@ -123,7 +123,7 @@ public abstract class BaseTestFunctionsFromSpreadsheet {
                 currentGroupComment = newMarkerValue;\r
             }\r
             HSSFCell evalCell = r.getCell(SS.COLUMN_INDEX_EVALUATION);\r
-            if (evalCell == null || evalCell.getCellType() != CellType.FORMULA) {\r
+            if (evalCell == null || evalCell.getCellTypeEnum() != CellType.FORMULA) {\r
                 continue;\r
             }\r
             String rowComment = getCellTextValue(r, SS.COLUMN_ROW_COMMENT, "row comment");\r
@@ -153,7 +153,7 @@ public abstract class BaseTestFunctionsFromSpreadsheet {
         assertNotNull(msg + " - Bad setup data expected value is null", expectedCell);\r
         assertNotNull(msg + " - actual value was null", actualValue);\r
 \r
-        if (expectedCell.getCellType() == CellType.ERROR) {\r
+        if (expectedCell.getCellTypeEnum() == CellType.ERROR) {\r
             int expectedErrorCode = expectedCell.getErrorCellValue();\r
             assertEquals(msg, CellType.ERROR, actualValue.getCellType());\r
             assertEquals(msg, ErrorEval.getText(expectedErrorCode), actualValue.formatAsString());\r
@@ -167,9 +167,9 @@ public abstract class BaseTestFunctionsFromSpreadsheet {
         assertNotEquals(msg, formatValue(expectedCell), ErrorEval.getText(actualValue.getErrorValue()));\r
 \r
         // wrong type error\r
-        assertEquals(msg, expectedCell.getCellType(), actualValue.getCellType());\r
+        assertEquals(msg, expectedCell.getCellTypeEnum(), actualValue.getCellType());\r
 \r
-        final CellType expectedCellType = expectedCell.getCellType();\r
+        final CellType expectedCellType = expectedCell.getCellTypeEnum();\r
         switch (expectedCellType) {\r
             case BOOLEAN:\r
                 assertEquals(msg, expectedCell.getBooleanCellValue(), actualValue.getBooleanValue());\r
@@ -212,25 +212,25 @@ public abstract class BaseTestFunctionsFromSpreadsheet {
         if(cell == null) {\r
             return null;\r
         }\r
-        if(cell.getCellType() == CellType.BLANK) {\r
+        if(cell.getCellTypeEnum() == CellType.BLANK) {\r
             return null;\r
         }\r
-        if(cell.getCellType() == CellType.STRING) {\r
+        if(cell.getCellTypeEnum() == CellType.STRING) {\r
             return cell.getRichStringCellValue().getString();\r
         }\r
 \r
         fail("Bad cell type for '" + columnName + "' column: ("\r
-                + cell.getCellType() + ") row (" + (r.getRowNum() +1) + ")");\r
+                + cell.getCellTypeEnum() + ") row (" + (r.getRowNum() +1) + ")");\r
         return "";\r
     }\r
 \r
     private static String formatValue(HSSFCell expecedCell) {\r
-        switch (expecedCell.getCellType()) {\r
+        switch (expecedCell.getCellTypeEnum()) {\r
             case BLANK: return "<blank>";\r
             case BOOLEAN: return Boolean.toString(expecedCell.getBooleanCellValue());\r
             case NUMERIC: return Double.toString(expecedCell.getNumericCellValue());\r
             case STRING: return expecedCell.getRichStringCellValue().getString();\r
-            default: fail("Unexpected cell type of expected value (" + expecedCell.getCellType() + ")");\r
+            default: fail("Unexpected cell type of expected value (" + expecedCell.getCellTypeEnum() + ")");\r
         }\r
         return "";\r
     }\r
index 6dff5eda3c1aaee5780d8329e403256d5f610e3a..39b1f28acd7556c1c3aa981a6381fa2354c3f277 100644 (file)
@@ -505,9 +505,9 @@ public final class TestCountFuncs extends TestCase {
         for (int rowIx=7; rowIx<=12; rowIx++) {
             HSSFRow row = sheet1.getRow(rowIx-1);
             HSSFCell cellA = row.getCell(0);  // cell containing a formula with COUNTIF
-            assertEquals(CellType.FORMULA, cellA.getCellType());
+            assertEquals(CellType.FORMULA, cellA.getCellTypeEnum());
             HSSFCell cellC = row.getCell(2);  // cell with a reference value
-            assertEquals(CellType.NUMERIC, cellC.getCellType());
+            assertEquals(CellType.NUMERIC, cellC.getCellTypeEnum());
 
             CellValue cv = fe.evaluate(cellA);
             double actualValue = cv.getNumberValue();
@@ -523,9 +523,9 @@ public final class TestCountFuncs extends TestCase {
         for (int rowIx=9; rowIx<=14; rowIx++) {
             HSSFRow row = sheet2.getRow(rowIx-1);
             HSSFCell cellA = row.getCell(0);  // cell containing a formula with COUNTIF
-            assertEquals(CellType.FORMULA, cellA.getCellType());
+            assertEquals(CellType.FORMULA, cellA.getCellTypeEnum());
             HSSFCell cellC = row.getCell(2);  // cell with a reference value
-            assertEquals(CellType.NUMERIC, cellC.getCellType());
+            assertEquals(CellType.NUMERIC, cellC.getCellTypeEnum());
 
             CellValue cv = fe.evaluate(cellA);
             double actualValue = cv.getNumberValue();
index ec5553d84c1f5d493e463c771b254c1e0a20bb3c..55c2714d0cb8e835a34cb4644e5e636cce0f1ac0 100644 (file)
@@ -58,12 +58,12 @@ public final class TestNper {
                cell.setCellFormula("NPER(12,4500,100000,100000)");
                cell.setCellValue(15.0);
                assertEquals("NPER(12,4500,100000,100000)", cell.getCellFormula());
-               assertEquals(CellType.NUMERIC, cell.getCachedFormulaResultType());
+               assertEquals(CellType.NUMERIC, cell.getCachedFormulaResultTypeEnum());
                assertEquals(15.0, cell.getNumericCellValue(), 0.0);
 
                HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb);
                fe.evaluateFormulaCell(cell);
-               assertEquals(CellType.ERROR, cell.getCachedFormulaResultType());
+               assertEquals(CellType.ERROR, cell.getCachedFormulaResultTypeEnum());
                assertEquals(FormulaError.NUM.getCode(), cell.getErrorCellValue());
                wb.close();
        }
index 68f987315961039f44caeaf0c63e05383394830f..f5c3087a96f5838f681187942781fdf2e7b5e27d 100644 (file)
@@ -952,7 +952,7 @@ public abstract class BaseTestBugzillaIssues {
             assertEquals(1, cArray.length);*/
 
             Cell cell = row.getCell(0);
-            assertEquals(CellType.FORMULA, cell.getCellType());
+            assertEquals(CellType.FORMULA, cell.getCellTypeEnum());
         }
 
         { // overwrite the row
@@ -1136,12 +1136,12 @@ public abstract class BaseTestBugzillaIssues {
         fe.evaluateFormulaCell(cfs);
 
         // Now test
-        assertEquals(CellType.NUMERIC, cn.getCellType());
-        assertEquals(CellType.STRING, cs.getCellType());
-        assertEquals(CellType.FORMULA, cfn.getCellType());
-        assertEquals(CellType.NUMERIC, cfn.getCachedFormulaResultType());
-        assertEquals(CellType.FORMULA, cfs.getCellType());
-        assertEquals(CellType.STRING, cfs.getCachedFormulaResultType());
+        assertEquals(CellType.NUMERIC, cn.getCellTypeEnum());
+        assertEquals(CellType.STRING, cs.getCellTypeEnum());
+        assertEquals(CellType.FORMULA, cfn.getCellTypeEnum());
+        assertEquals(CellType.NUMERIC, cfn.getCachedFormulaResultTypeEnum());
+        assertEquals(CellType.FORMULA, cfs.getCellTypeEnum());
+        assertEquals(CellType.STRING, cfs.getCachedFormulaResultTypeEnum());
 
         // Different ways of retrieving
         assertEquals(1.2, cn.getNumericCellValue(), 0);
@@ -1383,7 +1383,7 @@ public abstract class BaseTestBugzillaIssues {
         Sheet s = wb.createSheet();
         Cell cell = s.createRow(0).createCell(0);
         cell.setCellValue((String)null);
-        assertEquals(CellType.BLANK, cell.getCellType());
+        assertEquals(CellType.BLANK, cell.getCellTypeEnum());
         
         _testDataProvider.trackAllColumnsForAutosizing(s);
         
@@ -1554,8 +1554,8 @@ public abstract class BaseTestBugzillaIssues {
         Cell cell = row.getCell(cellId);
 
         System.out.println("Formula:" + cell.getCellFormula());
-        if (CellType.FORMULA == cell.getCellType()) {
-            CellType formulaResultType = cell.getCachedFormulaResultType();
+        if (CellType.FORMULA == cell.getCellTypeEnum()) {
+            CellType formulaResultType = cell.getCachedFormulaResultTypeEnum();
             System.out.println("Formula Result Type:" + formulaResultType);
         }
 
@@ -1569,8 +1569,8 @@ public abstract class BaseTestBugzillaIssues {
         cell = row.getCell(cellId);
         System.out.println("Formula:" + cell.getCellFormula());
 
-        if (CellType.FORMULA == cell.getCellType()) {
-            CellType formulaResultType = cell.getCachedFormulaResultType();
+        if (CellType.FORMULA == cell.getCellTypeEnum()) {
+            CellType formulaResultType = cell.getCachedFormulaResultTypeEnum();
             System.out.println("Formula Result Type:" + formulaResultType);
         }
 
index 9570341fd6632bcb3e3d6ba364b06dba42a535d7..4d33aa36c10c4fa9c0fab92f9ff37039b8c0347e 100644 (file)
@@ -60,13 +60,13 @@ public abstract class BaseTestCell {
 
         cell.setCellValue(1.2);
         assertEquals(1.2, cell.getNumericCellValue(), 0.0001);
-        assertEquals(CellType.NUMERIC, cell.getCellType());
+        assertEquals(CellType.NUMERIC, cell.getCellTypeEnum());
         assertProhibitedValueAccess(cell, CellType.BOOLEAN, CellType.STRING,
                 CellType.FORMULA, CellType.ERROR);
 
         cell.setCellValue(false);
         assertEquals(false, cell.getBooleanCellValue());
-        assertEquals(CellType.BOOLEAN, cell.getCellType());
+        assertEquals(CellType.BOOLEAN, cell.getCellTypeEnum());
         cell.setCellValue(true);
         assertEquals(true, cell.getBooleanCellValue());
         assertProhibitedValueAccess(cell, CellType.NUMERIC, CellType.STRING,
@@ -75,14 +75,14 @@ public abstract class BaseTestCell {
         cell.setCellValue(factory.createRichTextString("Foo"));
         assertEquals("Foo", cell.getRichStringCellValue().getString());
         assertEquals("Foo", cell.getStringCellValue());
-        assertEquals(CellType.STRING, cell.getCellType());
+        assertEquals(CellType.STRING, cell.getCellTypeEnum());
         assertProhibitedValueAccess(cell, CellType.NUMERIC, CellType.BOOLEAN,
                 CellType.FORMULA, CellType.ERROR);
 
         cell.setCellValue("345");
         assertEquals("345", cell.getRichStringCellValue().getString());
         assertEquals("345", cell.getStringCellValue());
-        assertEquals(CellType.STRING, cell.getCellType());
+        assertEquals(CellType.STRING, cell.getCellTypeEnum());
         assertProhibitedValueAccess(cell, CellType.NUMERIC, CellType.BOOLEAN,
                 CellType.FORMULA, CellType.ERROR);
 
@@ -90,19 +90,19 @@ public abstract class BaseTestCell {
         c.setTimeInMillis(123456789);
         cell.setCellValue(c.getTime());
         assertEquals(c.getTime().getTime(), cell.getDateCellValue().getTime());
-        assertEquals(CellType.NUMERIC, cell.getCellType());
+        assertEquals(CellType.NUMERIC, cell.getCellTypeEnum());
         assertProhibitedValueAccess(cell, CellType.BOOLEAN, CellType.STRING,
                 CellType.FORMULA, CellType.ERROR);
 
         cell.setCellValue(c);
         assertEquals(c.getTime().getTime(), cell.getDateCellValue().getTime());
-        assertEquals(CellType.NUMERIC, cell.getCellType());
+        assertEquals(CellType.NUMERIC, cell.getCellTypeEnum());
         assertProhibitedValueAccess(cell, CellType.BOOLEAN, CellType.STRING,
                 CellType.FORMULA, CellType.ERROR);
 
         cell.setCellErrorValue(FormulaError.NA.getCode());
         assertEquals(FormulaError.NA.getCode(), cell.getErrorCellValue());
-        assertEquals(CellType.ERROR, cell.getCellType());
+        assertEquals(CellType.ERROR, cell.getCellTypeEnum());
         assertProhibitedValueAccess(cell, CellType.NUMERIC, CellType.BOOLEAN,
                 CellType.FORMULA, CellType.STRING);
         
@@ -176,13 +176,13 @@ public abstract class BaseTestCell {
         c = r.getCell(1);
         assertEquals(0, c.getRowIndex());
         assertEquals(1, c.getColumnIndex());
-        assertEquals(CellType.BOOLEAN, c.getCellType());
+        assertEquals(CellType.BOOLEAN, c.getCellTypeEnum());
         assertEquals("B1 value", true, c.getBooleanCellValue());
         
         c = r.getCell(2);
         assertEquals(0, c.getRowIndex());
         assertEquals(2, c.getColumnIndex());
-        assertEquals(CellType.BOOLEAN, c.getCellType());
+        assertEquals(CellType.BOOLEAN, c.getCellTypeEnum());
         assertEquals("C1 value", false, c.getBooleanCellValue());
         
         wb2.close();
@@ -226,13 +226,13 @@ public abstract class BaseTestCell {
         c = r.getCell(1);
         assertEquals(0, c.getRowIndex());
         assertEquals(1, c.getColumnIndex());
-        assertEquals(CellType.ERROR, c.getCellType());
+        assertEquals(CellType.ERROR, c.getCellTypeEnum());
         assertEquals("B1 value == #NULL!", FormulaError.NULL.getCode(), c.getErrorCellValue());
 
         c = r.getCell(2);
         assertEquals(0, c.getRowIndex());
         assertEquals(2, c.getColumnIndex());
-        assertEquals(CellType.ERROR, c.getCellType());
+        assertEquals(CellType.ERROR, c.getCellTypeEnum());
         assertEquals("C1 value == #DIV/0!", FormulaError.DIV0.getCode(), c.getErrorCellValue());
 
         wb2.close();
@@ -272,7 +272,7 @@ public abstract class BaseTestCell {
         r = s.getRow(0);
         c = r.getCell(0);
 
-        assertEquals("Formula Cell at 0,0", CellType.FORMULA, c.getCellType());
+        assertEquals("Formula Cell at 0,0", CellType.FORMULA, c.getCellTypeEnum());
         cs = c.getCellStyle();
 
         assertNotNull("Formula Cell Style", cs);
@@ -347,25 +347,25 @@ public abstract class BaseTestCell {
         Cell c1 = r.createCell(0);
         c1.setCellFormula("NA()");
         assertEquals(0.0, c1.getNumericCellValue(), 0.0);
-        assertEquals(CellType.NUMERIC, c1.getCachedFormulaResultType());
+        assertEquals(CellType.NUMERIC, c1.getCachedFormulaResultTypeEnum());
         c1.setCellValue(10);
         assertEquals(10.0, c1.getNumericCellValue(), 0.0);
-        assertEquals(CellType.FORMULA, c1.getCellType());
-        assertEquals(CellType.NUMERIC, c1.getCachedFormulaResultType());
+        assertEquals(CellType.FORMULA, c1.getCellTypeEnum());
+        assertEquals(CellType.NUMERIC, c1.getCachedFormulaResultTypeEnum());
 
         Cell c2 = r.createCell(1);
         c2.setCellFormula("NA()");
         assertEquals(0.0, c2.getNumericCellValue(), 0.0);
-        assertEquals(CellType.NUMERIC, c2.getCachedFormulaResultType());
+        assertEquals(CellType.NUMERIC, c2.getCachedFormulaResultTypeEnum());
         c2.setCellValue("I changed!");
         assertEquals("I changed!", c2.getStringCellValue());
-        assertEquals(CellType.FORMULA, c2.getCellType());
-        assertEquals(CellType.STRING, c2.getCachedFormulaResultType());
+        assertEquals(CellType.FORMULA, c2.getCellTypeEnum());
+        assertEquals(CellType.STRING, c2.getCachedFormulaResultTypeEnum());
 
         //calglin Cell.setCellFormula(null) for a non-formula cell
         Cell c3 = r.createCell(2);
         c3.setCellFormula(null);
-        assertEquals(CellType.BLANK, c3.getCellType());
+        assertEquals(CellType.BLANK, c3.getCellTypeEnum());
         wb.close();
 
     }
@@ -420,11 +420,11 @@ public abstract class BaseTestCell {
         Cell cell = createACell(wb);
 
         cell.setCellValue("TRUE");
-        assertEquals(CellType.STRING, cell.getCellType());
+        assertEquals(CellType.STRING, cell.getCellTypeEnum());
         // test conversion of cell from text to boolean
         cell.setCellType(CellType.BOOLEAN);
 
-        assertEquals(CellType.BOOLEAN, cell.getCellType());
+        assertEquals(CellType.BOOLEAN, cell.getCellTypeEnum());
         assertEquals(true, cell.getBooleanCellValue());
         cell.setCellType(CellType.STRING);
         assertEquals("TRUE", cell.getRichStringCellValue().getString());
@@ -432,7 +432,7 @@ public abstract class BaseTestCell {
         // 'false' text to bool and back
         cell.setCellValue("FALSE");
         cell.setCellType(CellType.BOOLEAN);
-        assertEquals(CellType.BOOLEAN, cell.getCellType());
+        assertEquals(CellType.BOOLEAN, cell.getCellTypeEnum());
         assertEquals(false, cell.getBooleanCellValue());
         cell.setCellType(CellType.STRING);
         assertEquals("FALSE", cell.getRichStringCellValue().getString());
@@ -589,17 +589,17 @@ public abstract class BaseTestCell {
 
         cell = row.createCell(0, CellType.NUMERIC);
         cell.setCellValue(1.0);
-        assertEquals(CellType.NUMERIC, cell.getCellType());
+        assertEquals(CellType.NUMERIC, cell.getCellTypeEnum());
         assertEquals(1.0, cell.getNumericCellValue(), 0.0);
 
         cell = row.createCell(1, CellType.NUMERIC);
         cell.setCellValue(2.0);
-        assertEquals(CellType.NUMERIC, cell.getCellType());
+        assertEquals(CellType.NUMERIC, cell.getCellTypeEnum());
         assertEquals(2.0, cell.getNumericCellValue(), 0.0);
 
         cell = row.createCell(2, CellType.FORMULA);
         cell.setCellFormula("SUM(A1:B1)");
-        assertEquals(CellType.FORMULA, cell.getCellType());
+        assertEquals(CellType.FORMULA, cell.getCellTypeEnum());
         assertEquals("SUM(A1:B1)", cell.getCellFormula());
 
         //serialize and check again
@@ -607,15 +607,15 @@ public abstract class BaseTestCell {
         wb1.close();
         row = wb2.getSheetAt(0).getRow(0);
         cell = row.getCell(0);
-        assertEquals(CellType.NUMERIC, cell.getCellType());
+        assertEquals(CellType.NUMERIC, cell.getCellTypeEnum());
         assertEquals(1.0, cell.getNumericCellValue(), 0.0);
 
         cell = row.getCell(1);
-        assertEquals(CellType.NUMERIC, cell.getCellType());
+        assertEquals(CellType.NUMERIC, cell.getCellTypeEnum());
         assertEquals(2.0, cell.getNumericCellValue(), 0.0);
 
         cell = row.getCell(2);
-        assertEquals(CellType.FORMULA, cell.getCellType());
+        assertEquals(CellType.FORMULA, cell.getCellTypeEnum());
         assertEquals("SUM(A1:B1)", cell.getCellFormula());
         wb2.close();
     }
@@ -672,17 +672,17 @@ public abstract class BaseTestCell {
 
         Cell cell0 = row.createCell(0);
         cell0.setCellValue(Double.NaN);
-        assertEquals("Double.NaN should change cell type to CellType#ERROR", CellType.ERROR, cell0.getCellType());
+        assertEquals("Double.NaN should change cell type to CellType#ERROR", CellType.ERROR, cell0.getCellTypeEnum());
         assertEquals("Double.NaN should change cell value to #NUM!", FormulaError.NUM, forInt(cell0.getErrorCellValue()));
 
         Cell cell1 = row.createCell(1);
         cell1.setCellValue(Double.POSITIVE_INFINITY);
-        assertEquals("Double.POSITIVE_INFINITY should change cell type to CellType#ERROR", CellType.ERROR, cell1.getCellType());
+        assertEquals("Double.POSITIVE_INFINITY should change cell type to CellType#ERROR", CellType.ERROR, cell1.getCellTypeEnum());
         assertEquals("Double.POSITIVE_INFINITY should change cell value to #DIV/0!", FormulaError.DIV0, forInt(cell1.getErrorCellValue()));
 
         Cell cell2 = row.createCell(2);
         cell2.setCellValue(Double.NEGATIVE_INFINITY);
-        assertEquals("Double.NEGATIVE_INFINITY should change cell type to CellType#ERROR", CellType.ERROR, cell2.getCellType());
+        assertEquals("Double.NEGATIVE_INFINITY should change cell type to CellType#ERROR", CellType.ERROR, cell2.getCellTypeEnum());
         assertEquals("Double.NEGATIVE_INFINITY should change cell value to #DIV/0!", FormulaError.DIV0, forInt(cell2.getErrorCellValue()));
 
         Workbook wb2 = _testDataProvider.writeOutAndReadBack(wb1);
@@ -690,15 +690,15 @@ public abstract class BaseTestCell {
         row = wb2.getSheetAt(0).getRow(0);
 
         cell0 = row.getCell(0);
-        assertEquals(CellType.ERROR, cell0.getCellType());
+        assertEquals(CellType.ERROR, cell0.getCellTypeEnum());
         assertEquals(FormulaError.NUM, forInt(cell0.getErrorCellValue()));
 
         cell1 = row.getCell(1);
-        assertEquals(CellType.ERROR, cell1.getCellType());
+        assertEquals(CellType.ERROR, cell1.getCellTypeEnum());
         assertEquals(FormulaError.DIV0, forInt(cell1.getErrorCellValue()));
 
         cell2 = row.getCell(2);
-        assertEquals(CellType.ERROR, cell2.getCellType());
+        assertEquals(CellType.ERROR, cell2.getCellTypeEnum());
         assertEquals(FormulaError.DIV0, forInt(cell2.getErrorCellValue()));
         wb2.close();
     }
@@ -899,21 +899,21 @@ public abstract class BaseTestCell {
         RichTextString nullStr = null;
         cell.setCellValue(nullStr);
         assertEquals("", cell.getStringCellValue());
-        assertEquals(CellType.BLANK, cell.getCellType());
+        assertEquals(CellType.BLANK, cell.getCellTypeEnum());
 
         cell = sheet.createRow(0).createCell(1);
         cell.setCellValue(1.2d);
-        assertEquals(CellType.NUMERIC, cell.getCellType());
+        assertEquals(CellType.NUMERIC, cell.getCellTypeEnum());
         cell.setCellValue(nullStr);
         assertEquals("", cell.getStringCellValue());
-        assertEquals(CellType.BLANK, cell.getCellType());
+        assertEquals(CellType.BLANK, cell.getCellTypeEnum());
 
         cell = sheet.createRow(0).createCell(1);
         cell.setCellValue(wb.getCreationHelper().createRichTextString("Test"));
-        assertEquals(CellType.STRING, cell.getCellType());
+        assertEquals(CellType.STRING, cell.getCellTypeEnum());
         cell.setCellValue(nullStr);
         assertEquals("", cell.getStringCellValue());
-        assertEquals(CellType.BLANK, cell.getCellType());
+        assertEquals(CellType.BLANK, cell.getCellTypeEnum());
 
         wb.close();
     }
index 27ac4c93a8578e136b986309c133174d1740e404..2492c20a8166d9f41918e2a397bf4c3dc41f5b28 100644 (file)
@@ -256,36 +256,36 @@ public abstract class BaseTestRow {
         row.createCell(5).setCellValue(4);
 
         // First up, no policy given, uses default
-        assertEquals(CellType.STRING,  row.getCell(0).getCellType());
-        assertEquals(CellType.NUMERIC, row.getCell(1).getCellType());
+        assertEquals(CellType.STRING,  row.getCell(0).getCellTypeEnum());
+        assertEquals(CellType.NUMERIC, row.getCell(1).getCellTypeEnum());
         assertEquals(null, row.getCell(2));
         assertEquals(null, row.getCell(3));
-        assertEquals(CellType.BLANK,   row.getCell(4).getCellType());
-        assertEquals(CellType.NUMERIC, row.getCell(5).getCellType());
+        assertEquals(CellType.BLANK,   row.getCell(4).getCellTypeEnum());
+        assertEquals(CellType.NUMERIC, row.getCell(5).getCellTypeEnum());
 
         // RETURN_NULL_AND_BLANK - same as default
-        assertEquals(CellType.STRING,  row.getCell(0, MissingCellPolicy.RETURN_NULL_AND_BLANK).getCellType());
-        assertEquals(CellType.NUMERIC, row.getCell(1, MissingCellPolicy.RETURN_NULL_AND_BLANK).getCellType());
+        assertEquals(CellType.STRING,  row.getCell(0, MissingCellPolicy.RETURN_NULL_AND_BLANK).getCellTypeEnum());
+        assertEquals(CellType.NUMERIC, row.getCell(1, MissingCellPolicy.RETURN_NULL_AND_BLANK).getCellTypeEnum());
         assertEquals(null, row.getCell(2, MissingCellPolicy.RETURN_NULL_AND_BLANK));
         assertEquals(null, row.getCell(3, MissingCellPolicy.RETURN_NULL_AND_BLANK));
-        assertEquals(CellType.BLANK,   row.getCell(4, MissingCellPolicy.RETURN_NULL_AND_BLANK).getCellType());
-        assertEquals(CellType.NUMERIC, row.getCell(5, MissingCellPolicy.RETURN_NULL_AND_BLANK).getCellType());
+        assertEquals(CellType.BLANK,   row.getCell(4, MissingCellPolicy.RETURN_NULL_AND_BLANK).getCellTypeEnum());
+        assertEquals(CellType.NUMERIC, row.getCell(5, MissingCellPolicy.RETURN_NULL_AND_BLANK).getCellTypeEnum());
 
         // RETURN_BLANK_AS_NULL - nearly the same
-        assertEquals(CellType.STRING,  row.getCell(0, MissingCellPolicy.RETURN_BLANK_AS_NULL).getCellType());
-        assertEquals(CellType.NUMERIC, row.getCell(1, MissingCellPolicy.RETURN_BLANK_AS_NULL).getCellType());
+        assertEquals(CellType.STRING,  row.getCell(0, MissingCellPolicy.RETURN_BLANK_AS_NULL).getCellTypeEnum());
+        assertEquals(CellType.NUMERIC, row.getCell(1, MissingCellPolicy.RETURN_BLANK_AS_NULL).getCellTypeEnum());
         assertEquals(null, row.getCell(2, MissingCellPolicy.RETURN_BLANK_AS_NULL));
         assertEquals(null, row.getCell(3, MissingCellPolicy.RETURN_BLANK_AS_NULL));
         assertEquals(null, row.getCell(4, MissingCellPolicy.RETURN_BLANK_AS_NULL));
-        assertEquals(CellType.NUMERIC, row.getCell(5, MissingCellPolicy.RETURN_BLANK_AS_NULL).getCellType());
+        assertEquals(CellType.NUMERIC, row.getCell(5, MissingCellPolicy.RETURN_BLANK_AS_NULL).getCellTypeEnum());
 
         // CREATE_NULL_AS_BLANK - creates as needed
-        assertEquals(CellType.STRING,  row.getCell(0, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellType());
-        assertEquals(CellType.NUMERIC, row.getCell(1, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellType());
-        assertEquals(CellType.BLANK,   row.getCell(2, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellType());
-        assertEquals(CellType.BLANK,   row.getCell(3, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellType());
-        assertEquals(CellType.BLANK,   row.getCell(4, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellType());
-        assertEquals(CellType.NUMERIC, row.getCell(5, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellType());
+        assertEquals(CellType.STRING,  row.getCell(0, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellTypeEnum());
+        assertEquals(CellType.NUMERIC, row.getCell(1, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellTypeEnum());
+        assertEquals(CellType.BLANK,   row.getCell(2, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellTypeEnum());
+        assertEquals(CellType.BLANK,   row.getCell(3, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellTypeEnum());
+        assertEquals(CellType.BLANK,   row.getCell(4, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellTypeEnum());
+        assertEquals(CellType.NUMERIC, row.getCell(5, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellTypeEnum());
 
         // Check created ones get the right column
         assertEquals(0, row.getCell(0, MissingCellPolicy.CREATE_NULL_AS_BLANK).getColumnIndex());
@@ -300,12 +300,12 @@ public abstract class BaseTestRow {
         //  that that is now used if no policy given
         workbook.setMissingCellPolicy(MissingCellPolicy.RETURN_BLANK_AS_NULL);
 
-        assertEquals(CellType.STRING,  row.getCell(0).getCellType());
-        assertEquals(CellType.NUMERIC, row.getCell(1).getCellType());
+        assertEquals(CellType.STRING,  row.getCell(0).getCellTypeEnum());
+        assertEquals(CellType.NUMERIC, row.getCell(1).getCellTypeEnum());
         assertEquals(null, row.getCell(2));
         assertEquals(null, row.getCell(3));
         assertEquals(null, row.getCell(4));
-        assertEquals(CellType.NUMERIC, row.getCell(5).getCellType());
+        assertEquals(CellType.NUMERIC, row.getCell(5).getCellTypeEnum());
         
         workbook.close();
     }
@@ -420,7 +420,7 @@ public abstract class BaseTestRow {
         assertTrue(cell5 == it.next());
         assertTrue(it.hasNext());
         assertTrue(cell2 == it.next());
-        assertEquals(CellType.STRING, cell5.getCellType());
+        assertEquals(CellType.STRING, cell5.getCellTypeEnum());
         wb.close();
     }
 
index f587b640a3ae890fadd6a0730c1c974160cfea0d..543a871ffed74814ec51a4579c1bbb149cda48d6 100644 (file)
@@ -344,7 +344,7 @@ public abstract class BaseTestSheetAutosizeColumn {
             Sheet sheet = workbook.getSheetAt(i);
             for (Row r : sheet) {
                 for (Cell c : r) {
-                    if (c.getCellType() == CellType.FORMULA){
+                    if (c.getCellTypeEnum() == CellType.FORMULA){
                         eval.evaluateFormulaCell(c);
                     }
                 }
index 7bfc606ec3d14c56393e0a4eb83ced77ed9d0e73..5e2ad4a8dfae8b1f3fca864680c7f26e3c6eff61 100644 (file)
@@ -133,7 +133,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
 
         for(Cell acell : cells){
             assertTrue(acell.isPartOfArrayFormulaGroup());
-            assertEquals(CellType.FORMULA, acell.getCellType());
+            assertEquals(CellType.FORMULA, acell.getCellTypeEnum());
             assertEquals("SUM(A1:A3*B1:B3)", acell.getCellFormula());
             //retrieve the range and check it is the same
             assertEquals(range.formatAsString(), acell.getArrayFormulaRange().formatAsString());
@@ -210,7 +210,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
 
         for(Cell acell : cr){
             assertFalse(acell.isPartOfArrayFormulaGroup());
-            assertEquals(CellType.BLANK, acell.getCellType());
+            assertEquals(CellType.BLANK, acell.getCellTypeEnum());
         }
 
         // cells C4:C6 are not included in array formula,
@@ -279,7 +279,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
         CellRange<? extends Cell> srange =
                 sheet.setArrayFormula("SUM(A4:A6,B4:B6)", CellRangeAddress.valueOf("B5"));
         Cell scell = srange.getTopLeftCell();
-        assertEquals(CellType.FORMULA, scell.getCellType());
+        assertEquals(CellType.FORMULA, scell.getCellTypeEnum());
         assertEquals(0.0, scell.getNumericCellValue(), 0);
         scell.setCellValue(1.1);
         assertEquals(1.1, scell.getNumericCellValue(), 0);
@@ -288,7 +288,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
         CellRange<? extends Cell> mrange =
                 sheet.setArrayFormula("A1:A3*B1:B3", CellRangeAddress.valueOf("C1:C3"));
         for(Cell mcell : mrange){
-            assertEquals(CellType.FORMULA, mcell.getCellType());
+            assertEquals(CellType.FORMULA, mcell.getCellTypeEnum());
             assertEquals(0.0, mcell.getNumericCellValue(), 0);
             double fmlaResult = 1.2;
             mcell.setCellValue(fmlaResult);
@@ -307,10 +307,10 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
         CellRange<? extends Cell> srange =
                 sheet.setArrayFormula("SUM(A4:A6,B4:B6)", CellRangeAddress.valueOf("B5"));
         Cell scell = srange.getTopLeftCell();
-        assertEquals(CellType.FORMULA, scell.getCellType());
+        assertEquals(CellType.FORMULA, scell.getCellTypeEnum());
         assertEquals(0.0, scell.getNumericCellValue(), 0);
         scell.setCellType(CellType.STRING);
-        assertEquals(CellType.STRING, scell.getCellType());
+        assertEquals(CellType.STRING, scell.getCellTypeEnum());
         scell.setCellValue("string cell");
         assertEquals("string cell", scell.getStringCellValue());
 
@@ -319,7 +319,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
                 sheet.setArrayFormula("A1:A3*B1:B3", CellRangeAddress.valueOf("C1:C3"));
         for(Cell mcell : mrange){
             try {
-                assertEquals(CellType.FORMULA, mcell.getCellType());
+                assertEquals(CellType.FORMULA, mcell.getCellTypeEnum());
                 mcell.setCellType(CellType.NUMERIC);
                 fail("expected exception");
             } catch (IllegalStateException e){
@@ -329,7 +329,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
             }
             // a failed invocation of Cell.setCellType leaves the cell
             // in the state that it was in prior to the invocation
-            assertEquals(CellType.FORMULA, mcell.getCellType());
+            assertEquals(CellType.FORMULA, mcell.getCellTypeEnum());
             assertTrue(mcell.isPartOfArrayFormulaGroup());
         }
         workbook.close();
@@ -344,13 +344,13 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
                 sheet.setArrayFormula("SUM(A4:A6,B4:B6)", CellRangeAddress.valueOf("B5"));
         Cell scell = srange.getTopLeftCell();
         assertEquals("SUM(A4:A6,B4:B6)", scell.getCellFormula());
-        assertEquals(CellType.FORMULA, scell.getCellType());
+        assertEquals(CellType.FORMULA, scell.getCellTypeEnum());
         assertTrue(scell.isPartOfArrayFormulaGroup());
         scell.setCellFormula("SUM(A4,A6)");
         //we are now a normal formula cell
         assertEquals("SUM(A4,A6)", scell.getCellFormula());
         assertFalse(scell.isPartOfArrayFormulaGroup());
-        assertEquals(CellType.FORMULA, scell.getCellType());
+        assertEquals(CellType.FORMULA, scell.getCellTypeEnum());
         //check that setting formula result works
         assertEquals(0.0, scell.getNumericCellValue(), 0);
         scell.setCellValue(33.0);
@@ -396,7 +396,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
 
         //re-create the removed cell
         scell = srow.createCell(cra.getFirstColumn());
-        assertEquals(CellType.BLANK, scell.getCellType());
+        assertEquals(CellType.BLANK, scell.getCellTypeEnum());
         assertFalse(scell.isPartOfArrayFormulaGroup());
 
         //we cannot remove cells included in a multi-cell array formula
@@ -417,7 +417,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
             // in the state that it was in prior to the invocation
             assertSame(mcell, mrow.getCell(columnIndex));
             assertTrue(mcell.isPartOfArrayFormulaGroup());
-            assertEquals(CellType.FORMULA, mcell.getCellType());
+            assertEquals(CellType.FORMULA, mcell.getCellTypeEnum());
         }
         
         workbook.close();
@@ -433,7 +433,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
         CellRange<? extends Cell> srange =
                 sheet.setArrayFormula("SUM(A4:A6,B4:B6)", cra);
         Cell scell = srange.getTopLeftCell();
-        assertEquals(CellType.FORMULA, scell.getCellType());
+        assertEquals(CellType.FORMULA, scell.getCellTypeEnum());
 
         Row srow = scell.getRow();
         assertSame(srow, sheet.getRow(cra.getFirstRow()));
@@ -442,7 +442,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
 
         //re-create the removed row and cell
         scell = sheet.createRow(cra.getFirstRow()).createCell(cra.getFirstColumn());
-        assertEquals(CellType.BLANK, scell.getCellType());
+        assertEquals(CellType.BLANK, scell.getCellTypeEnum());
         assertFalse(scell.isPartOfArrayFormulaGroup());
 
         //we cannot remove rows with cells included in a multi-cell array formula
@@ -463,7 +463,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
             assertSame(mrow, sheet.getRow(mrow.getRowNum()));
             assertSame(mcell, mrow.getCell(columnIndex));
             assertTrue(mcell.isPartOfArrayFormulaGroup());
-            assertEquals(CellType.FORMULA, mcell.getCellType());
+            assertEquals(CellType.FORMULA, mcell.getCellTypeEnum());
         }
         
         workbook.close();
@@ -481,7 +481,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
         Cell scell = srange.getTopLeftCell();
         sheet.addMergedRegion(CellRangeAddress.valueOf("B5:C6"));
         //we are still an array formula
-        assertEquals(CellType.FORMULA, scell.getCellType());
+        assertEquals(CellType.FORMULA, scell.getCellTypeEnum());
         assertTrue(scell.isPartOfArrayFormulaGroup());
         assertEquals(1, sheet.getNumMergedRegions());
         
index 7a668b016dbb5d1ea725fa3f1319319af79b734c..d081db0fc363675e13ec7544159a6369b1b298e0 100644 (file)
@@ -50,7 +50,7 @@ public final class TestSheetBuilder extends TestCase {
         Row firstRow = sheet.getRow(0);
         Cell firstCell = firstRow.getCell(0);
 
-        assertEquals(firstCell.getCellType(), CellType.NUMERIC);
+        assertEquals(firstCell.getCellTypeEnum(), CellType.NUMERIC);
         assertEquals(1.0, firstCell.getNumericCellValue(), 0.00001);
 
 
@@ -59,11 +59,11 @@ public final class TestSheetBuilder extends TestCase {
         assertNull(secondRow.getCell(2));
 
         Row thirdRow = sheet.getRow(2);
-        assertEquals(CellType.STRING, thirdRow.getCell(0).getCellType());
+        assertEquals(CellType.STRING, thirdRow.getCell(0).getCellTypeEnum());
         String cellValue = thirdRow.getCell(0).getStringCellValue();
         assertEquals(testData[2][0].toString(), cellValue);
 
-        assertEquals(CellType.FORMULA, thirdRow.getCell(2).getCellType());
+        assertEquals(CellType.FORMULA, thirdRow.getCell(2).getCellTypeEnum());
         assertEquals("A1+B2", thirdRow.getCell(2).getCellFormula());
     }
 
@@ -73,7 +73,7 @@ public final class TestSheetBuilder extends TestCase {
 
         Cell emptyCell = sheet.getRow(1).getCell(1);
         assertNotNull(emptyCell);
-        assertEquals(CellType.BLANK, emptyCell.getCellType());
+        assertEquals(CellType.BLANK, emptyCell.getCellTypeEnum());
     }
 
     public void testSheetName() {