]> source.dussan.org Git - poi.git/commitdiff
More javadocs for Cell.setCellType
authorNick Burch <nick@apache.org>
Thu, 12 Dec 2013 05:22:26 +0000 (05:22 +0000)
committerNick Burch <nick@apache.org>
Thu, 12 Dec 2013 05:22:26 +0000 (05:22 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1550349 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/hssf/usermodel/HSSFCell.java
src/java/org/apache/poi/ss/usermodel/Cell.java

index 6fd4dd5bf9acafac4e625977fa567f9e8d5e839f..a28d023aff59352c6e7c558da7366d6951523524 100644 (file)
@@ -19,7 +19,10 @@ package org.apache.poi.hssf.usermodel;
 
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
 
 import org.apache.poi.hssf.model.HSSFFormulaParser;
 import org.apache.poi.hssf.model.InternalWorkbook;
@@ -35,17 +38,22 @@ import org.apache.poi.hssf.record.Record;
 import org.apache.poi.hssf.record.RecordBase;
 import org.apache.poi.hssf.record.aggregates.FormulaRecordAggregate;
 import org.apache.poi.hssf.record.common.UnicodeString;
+import org.apache.poi.ss.SpreadsheetVersion;
+import org.apache.poi.ss.formula.FormulaType;
+import org.apache.poi.ss.formula.eval.ErrorEval;
 import org.apache.poi.ss.formula.ptg.ExpPtg;
 import org.apache.poi.ss.formula.ptg.Ptg;
-import org.apache.poi.ss.formula.eval.ErrorEval;
-import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.CellStyle;
+import org.apache.poi.ss.usermodel.Comment;
+import org.apache.poi.ss.usermodel.FormulaError;
+import org.apache.poi.ss.usermodel.Hyperlink;
+import org.apache.poi.ss.usermodel.RichTextString;
 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.ss.formula.FormulaType;
-import org.apache.poi.ss.SpreadsheetVersion;
-import org.apache.poi.util.POILogger;
 import org.apache.poi.util.POILogFactory;
+import org.apache.poi.util.POILogger;
 
 /**
  * High level representation of a cell in a row of a spreadsheet.
@@ -254,7 +262,9 @@ public class HSSFCell implements Cell {
     }
 
     /**
-     * set the cells type (numeric, formula or string)
+     * Set the cells type (numeric, formula or string).
+     * If the cell currently contains a value, the value will
+     *  be converted to match the new type, if possible.
      * @see #CELL_TYPE_NUMERIC
      * @see #CELL_TYPE_STRING
      * @see #CELL_TYPE_FORMULA
index 7859e029d8d5a1253ee60e71160c0f980a4dc205..0a3f668cf45944c0f8867bb765b5208871679e32 100644 (file)
@@ -109,9 +109,12 @@ public interface Cell {
      Row getRow();
 
     /**
-     * Set the cells type (numeric, formula or string)
+     * Set the cells type (numeric, formula or string).
+     * If the cell currently contains a value, the value will
+     *  be converted to match the new type, if possible.
      *
      * @throws IllegalArgumentException if the specified cell type is invalid
+     * @throws IllegalStateException if the current value cannot be converted to the new type
      * @see #CELL_TYPE_NUMERIC
      * @see #CELL_TYPE_STRING
      * @see #CELL_TYPE_FORMULA