]> source.dussan.org Git - poi.git/commitdiff
bug 59791: add @since to Cell, EvaluationCell, and FormulaEvaluator CellType getter...
authorJaven O'Neal <onealj@apache.org>
Mon, 4 Jul 2016 12:35:49 +0000 (12:35 +0000)
committerJaven O'Neal <onealj@apache.org>
Mon, 4 Jul 2016 12:35:49 +0000 (12:35 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1751264 13f79535-47bb-0310-9956-ffa450edef68

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/ss/formula/EvaluationCell.java
src/java/org/apache/poi/ss/formula/eval/forked/ForkedEvaluationCell.java
src/java/org/apache/poi/ss/usermodel/Cell.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/usermodel/BaseXSSFFormulaEvaluator.java
src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java
src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationCell.java

index 314612fa6895ff777d3992bdb6b1de373d61452d..6974360a7a9eda81a153c302691262c1a2607e8e 100644 (file)
@@ -455,7 +455,9 @@ public class HSSFCell implements Cell {
     
     /**
      * get the cells type (numeric, formula or string)
+     * @since POI 3.15 beta 3
      * @deprecated POI 3.15 beta 3
+     * Will be deleted when we make the CellType enum transition. See bug 59791.
      */
     @Internal
     @Override
@@ -1163,7 +1165,9 @@ public class HSSFCell implements Cell {
      * @return one of ({@link CellType#NUMERIC}, {@link CellType#STRING},
      *     {@link CellType#BOOLEAN}, {@link CellType#ERROR}) depending
      * on the cached value of the formula
+     * @since POI 3.15 beta 3
      * @deprecated POI 3.15 beta 3
+     * Will be deleted when we make the CellType enum transition. See bug 59791.
      */
     @Internal
     @Override
index 6cb3f2b6f4425cef660cfe67422cb9c71c78244d..808655a5390f09e12a8d984f02b04cfb4310857d 100644 (file)
@@ -60,7 +60,11 @@ final class HSSFEvaluationCell implements EvaluationCell {
        public int getCellType() {
                return _cell.getCellType();
        }
-       /** @deprecated POI 3.15 beta 3 */
+       /**
+        * @since POI 3.15 beta 3
+        * @deprecated POI 3.15 beta 3.
+        * Will be deleted when we make the CellType enum transition. See bug 59791.
+        */
        @Internal
        @Override
        public CellType getCellTypeEnum() {
@@ -100,7 +104,11 @@ final class HSSFEvaluationCell implements EvaluationCell {
        public int getCachedFormulaResultType() {
                return _cell.getCachedFormulaResultType();
        }
-       /** @deprecated POI 3.15 beta 3 */
+       /**
+        * @since POI 3.15 beta 3
+        * @deprecated POI 3.15 beta 3.
+        * Will be deleted when we make the CellType enum transition. See bug 59791.
+        */
        @Internal\r
        @Override
        public CellType getCachedFormulaResultTypeEnum() {\r
index 1da6a393232ff3f765f5b94948c36fab2c193c96..139df673da000ae8cb3348a1935e849afd81385f 100644 (file)
@@ -219,32 +219,32 @@ public class HSSFFormulaEvaluator implements FormulaEvaluator, WorkbookEvaluator
        }
        
        /**
-     * If cell contains formula, it evaluates the formula, and saves the result of the formula. The
-     * cell remains as a formula cell. If the cell does not contain formula, this method returns -1
-     * and leaves the cell unchanged.
-     *
-     * Note that the type of the <em>formula result</em> is returned, so you know what kind of
-     * cached formula result is also stored with  the formula.
-     * <pre>
-     * int evaluatedCellType = evaluator.evaluateFormulaCell(cell);
-     * </pre>
-     * Be aware that your cell will hold both the formula, and the result. If you want the cell
-     * replaced with the result of the formula, use {@link #evaluateInCell(org.apache.poi.ss.usermodel.Cell)}
-     * @param cell The cell to evaluate
-     * @return -1 for non-formula cells, or the type of the <em>formula result</em>
-     * @deprecated POI 3.15 beta 3
-     */
-    @Internal
-    @Override
-    public CellType evaluateFormulaCellEnum(Cell cell) {
-        if (cell == null || cell.getCellTypeEnum() != CellType.FORMULA) {
-            return CellType._UNINITIALIZED;
-        }
-        CellValue cv = evaluateFormulaCellValue(cell);
-        // cell remains a formula cell, but the cached value is changed
-        setCellValue(cell, cv);
-        return cv.getCellType();
-    }
+        * If cell contains formula, it evaluates the formula, and saves the result of the formula. The
+        * cell remains as a formula cell. If the cell does not contain formula, this method returns -1
+        * and leaves the cell unchanged.
+        *
+        * Note that the type of the <em>formula result</em> is returned, so you know what kind of
+        * cached formula result is also stored with  the formula.
+        * <pre>
+        * int evaluatedCellType = evaluator.evaluateFormulaCell(cell);
+        * </pre>
+        * Be aware that your cell will hold both the formula, and the result. If you want the cell
+        * replaced with the result of the formula, use {@link #evaluateInCell(org.apache.poi.ss.usermodel.Cell)}
+        * @param cell The cell to evaluate
+        * @return -1 for non-formula cells, or the type of the <em>formula result</em>
+        * @deprecated POI 3.15 beta 3. Will be deleted when we make the CellType enum transition. See bug 59791.
+        */
+       @Internal
+       @Override
+       public CellType evaluateFormulaCellEnum(Cell cell) {
+               if (cell == null || cell.getCellTypeEnum() != CellType.FORMULA) {
+                       return CellType._UNINITIALIZED;
+               }
+               CellValue cv = evaluateFormulaCellValue(cell);
+               // cell remains a formula cell, but the cached value is changed
+               setCellValue(cell, cv);
+               return cv.getCellType();
+       }
 
        /**
         * If cell contains formula, it evaluates the formula, and
@@ -262,7 +262,7 @@ public class HSSFFormulaEvaluator implements FormulaEvaluator, WorkbookEvaluator
         *  value computed for you, use {@link #evaluateFormulaCellEnum(Cell)}}
         */
        @Override
-    public HSSFCell evaluateInCell(Cell cell) {
+       public HSSFCell evaluateInCell(Cell cell) {
                if (cell == null) {
                        return null;
                }
index e4378a4df0be819b54015603d154abd76db6ef66..3695fe28020409f2d3e4b2152f55d6d39a0792b2 100644 (file)
@@ -44,7 +44,11 @@ public interface EvaluationCell {
         * @return cell type
         */
        int getCellType();
-       /** @deprecated POI 3.15 beta 3 */
+       /**
+        * @since POI 3.15 beta 3
+        * @deprecated POI 3.15 beta 3.
+        * Will be deleted when we make the CellType enum transition. See bug 59791.
+        */
        CellType getCellTypeEnum();
 
        double getNumericCellValue();
@@ -59,6 +63,10 @@ public interface EvaluationCell {
         * @return cell type of cached formula result
         */
        int getCachedFormulaResultType();
-       /** @deprecated POI 3.15 beta 3 */\r
+       /**
+        * @since POI 3.15 beta 3
+        * @deprecated POI 3.15 beta 3.
+        * Will be deleted when we make the CellType enum transition. See bug 59791.
+        */\r
        CellType getCachedFormulaResultTypeEnum();\r
 }\r
index 8149774142de7d9aab019a3510e7eaf2279d1c3c..d961439a35675b4f85caccc12199add373c4d2ab 100644 (file)
@@ -113,7 +113,11 @@ final class ForkedEvaluationCell implements EvaluationCell {
        public int getCellType() {
                return _cellType.getCode();
        }
-       /** @deprecated POI 3.15 beta 3 */
+       /**
+        * @since POI 3.15 beta 3
+        * @deprecated POI 3.15 beta 3.
+        * Will be deleted when we make the CellType enum transition. See bug 59791.
+        */
        @Internal
        @Override
        public CellType getCellTypeEnum() {
@@ -161,7 +165,11 @@ final class ForkedEvaluationCell implements EvaluationCell {
        public int getCachedFormulaResultType() {
                return _masterCell.getCachedFormulaResultType();
        }
-       /** @deprecated POI 3.15 beta 3. */
+       /**
+        * @since POI 3.15 beta 3
+        * @deprecated POI 3.15 beta 3.
+        * Will be deleted when we make the CellType enum transition. See bug 59791.
+        */
        @Internal
        @Override
        public CellType getCachedFormulaResultTypeEnum() {
index c6421b3b471cbbf2c684d0c7f4ea77b153912cae..68bc8f67e684c2921bd837cc818bb27c72e4c2c3 100644 (file)
@@ -166,7 +166,9 @@ public interface Cell {
      * Return the cell type.
      *
      * @return the cell type
+     * @since POI 3.15 beta 3
      * @deprecated POI 3.15 beta 3
+     * Will be deleted when we make the CellType enum transition. See bug 59791.
      */
     @Internal
     CellType getCellTypeEnum();
@@ -188,7 +190,9 @@ public interface Cell {
      * @return one of ({@link CellType#NUMERIC}, {@link CellType#STRING},
      *     {@link CellType#BOOLEAN}, {@link CellType#ERROR}) depending
      * on the cached value of the formula
+     * @since POI 3.15 beta 3
      * @deprecated POI 3.15 beta 3
+     * Will be deleted when we make the CellType enum transition. See bug 59791.
      */
     @Internal
     CellType getCachedFormulaResultTypeEnum();
index 284d85ab86f50e4bccba7f5477bb7acbfcd8e3b4..e4bfff808bf94a74f5ea7780f6d4eebddceea877 100644 (file)
@@ -128,6 +128,7 @@ public class SXSSFCell implements Cell {
      * @see CellType#BOOLEAN
      * @see CellType#ERROR
      * @deprecated POI 3.15 beta 3. Use {@link #setCellType(CellType)} instead.
+     * Will be deleted when we make the CellType enum transition. See bug 59791.
      */
     @Override
     public void setCellType(int cellType)
@@ -160,7 +161,9 @@ public class SXSSFCell implements Cell {
      * Return the cell type.
      *
      * @return the cell type
+     * @since POI 3.15 beta 3
      * @deprecated POI 3.15 beta 3
+     * Will be deleted when we make the CellType enum transition. See bug 59791.
      */
     @Internal
     @Override
@@ -186,7 +189,9 @@ public class SXSSFCell implements Cell {
      * @return one of ({@link CellType#NUMERIC}, {@link CellType#STRING},
      *     {@link CellType#BOOLEAN}, {@link CellType#ERROR}) depending
      * on the cached value of the formula
+     * @since POI 3.15 beta 3
      * @deprecated POI 3.15 beta 3.
+     * Will be deleted when we make the CellType enum transition. See bug 59791.
      */
     @Internal
     @Override
index 73af9aa74ea7488a4b592dd4ed1659fef82e7d9b..bdb9d64e985ebaeb08ac31049990283ae5544c0e 100644 (file)
@@ -62,7 +62,11 @@ final class SXSSFEvaluationCell implements EvaluationCell {
     public int getCellType() {
         return _cell.getCellType();
     }
-    /** @deprecated POI 3.15 beta 3 */
+    /**
+     * @since POI 3.15 beta 3
+     * @deprecated POI 3.15 beta 3.
+     * Will be deleted when we make the CellType enum transition. See bug 59791.
+     */
     @Internal
     @Override
     public CellType getCellTypeEnum() {
@@ -102,7 +106,11 @@ final class SXSSFEvaluationCell implements EvaluationCell {
     public int getCachedFormulaResultType() {
         return _cell.getCachedFormulaResultType();
     }
-    /** @deprecated POI 3.15 beta 3 */
+    /**
+     * @since POI 3.15 beta 3
+     * @deprecated POI 3.15 beta 3.
+     * Will be deleted when we make the CellType enum transition. See bug 59791.
+     */
     @Internal\r
     @Override
     public CellType getCachedFormulaResultTypeEnum() {\r
index e366301236ad0940a540b814474412d89bf25bb7..c28b0762a5925e3b7812d54398ba90aac7ad6dab 100644 (file)
@@ -127,7 +127,7 @@ public abstract class BaseXSSFFormulaEvaluator implements FormulaEvaluator, Work
      *  so you know what kind of value is also stored with
      *  the formula.
      * <pre>
-     * int evaluatedCellType = evaluator.evaluateFormulaCell(cell);
+     * CellType evaluatedCellType = evaluator.evaluateFormulaCellEnum(cell);
      * </pre>
      * Be aware that your cell will hold both the formula,
      *  and the result. If you want the cell replaced with
index 850f398d1668b03a736938ae5a445af1a58d339d..44432a8bf5b03329d27aae4f7187bf73ed6a8a77 100644 (file)
@@ -678,7 +678,9 @@ public final class XSSFCell implements Cell {
      * Return the cell type.
      *
      * @return the cell type
+     * @since POI 3.15 beta 3
      * @deprecated POI 3.15 beta 3
+     * Will be deleted when we make the CellType enum transition. See bug 59791.
      */
     @Internal
     @Override
@@ -708,7 +710,9 @@ public final class XSSFCell implements Cell {
      * @return one of ({@link CellType#NUMERIC}, {@link CellType#STRING},
      *     {@link CellType#BOOLEAN}, {@link CellType#ERROR}) depending
      * on the cached value of the formula
+     * @since POI 3.15 beta 3
      * @deprecated POI 3.15 beta 3
+     * Will be deleted when we make the CellType enum transition. See bug 59791.
      */
     @Internal
     @Override
index 25a0cf2839f9fa295d920d646042e64f4c3914e1..97e92c3c8ee5e43dd1b8011990822dca93cd5f3d 100644 (file)
@@ -63,7 +63,11 @@ final class XSSFEvaluationCell implements EvaluationCell {
        public int getCellType() {
                return _cell.getCellType();
        }
-       /** @deprecated POI 3.15 beta 3 */
+       /**
+        * @since POI 3.15 beta 3
+        * @deprecated POI 3.15 beta 3.
+        * Will be deleted when we make the CellType enum transition. See bug 59791.
+        */
        @Internal
        @Override
        public CellType getCellTypeEnum() {
@@ -103,7 +107,11 @@ final class XSSFEvaluationCell implements EvaluationCell {
        public int getCachedFormulaResultType() {
                return _cell.getCachedFormulaResultType();
        }
-       /** @deprecated POI 3.15 beta 3 */
+       /**
+        * @since POI 3.15 beta 3
+        * @deprecated POI 3.15 beta 3.
+        * Will be deleted when we make the CellType enum transition. See bug 59791.
+        */
        @Internal\r
        @Override
        public CellType getCachedFormulaResultTypeEnum() {\r