]> source.dussan.org Git - poi.git/commitdiff
Add some more JavaDoc
authorDominik Stadler <centic@apache.org>
Tue, 2 Nov 2021 13:18:35 +0000 (13:18 +0000)
committerDominik Stadler <centic@apache.org>
Tue, 2 Nov 2021 13:18:35 +0000 (13:18 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1894679 13f79535-47bb-0310-9956-ffa450edef68

poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
poi/src/main/java/org/apache/poi/ss/formula/EvaluationWorkbook.java

index f1e190b89acdc33f7b29f76596c9e12f3cedfb86..a9e0ed0a7916ad2b9e43a0ec1432abcd80b6071e 100644 (file)
@@ -247,7 +247,7 @@ public final class HSSFWorkbook extends POIDocument implements Workbook {
     public static int getMaxImageLength() {
         return MAX_IMAGE_LENGTH;
     }
-    
+
     /**
      * Creates new HSSFWorkbook from scratch (start here!)
      */
@@ -789,7 +789,7 @@ public final class HSSFWorkbook extends POIDocument implements Workbook {
      * Returns the index of the sheet by his name
      *
      * @param name the sheet name
-     * @return index of the sheet (0 based)
+     * @return index of the sheet (0 based) or -1 if it was not found.
      */
     @Override
     public int getSheetIndex(String name) {
index c0469f7e5d8242f3fa072a3bf897cdb99200dadc..90600ec5a358f75f8350a4ee0e8d3d97b86ed080 100644 (file)
@@ -29,27 +29,49 @@ import org.apache.poi.util.Internal;
  */
 @Internal
 public interface EvaluationWorkbook {
+
+       /**
+        * Returns the name of the sheet at the given 0-based index.
+        *
+        * @param sheetIndex The 0-based index of the sheet
+        * @return The name of the sheet
+        * @throws IllegalArgumentException If the index is outside the indices of available sheets
+        */
     String getSheetName(int sheetIndex);
+
     /**
      * @return -1 if the specified sheet is from a different book
      */
     int getSheetIndex(EvaluationSheet sheet);
+
     /**
      * Finds a sheet index by case insensitive name.
      * @return the index of the sheet matching the specified name.  -1 if not found
      */
     int getSheetIndex(String sheetName);
 
+       /**
+        * Get the sheet identified by the given 0-based index.
+        *
+        * @param sheetIndex The 0-based index of the sheet
+        * @return The sheet
+        * @throws IllegalArgumentException If the index is outside the indices of available sheets
+        */
     EvaluationSheet getSheet(int sheetIndex);
 
     /**
      * HSSF Only - fetch the external-style sheet details
      * <p>Return will have no workbook set if it's actually in our own workbook</p>
+        * @return The found sheet or null if not found
+        * @throws IllegalStateException If called with XSSF or SXSSF workbooks
      */
     ExternalSheet getExternalSheet(int externSheetIndex);
+
     /**
      * XSSF Only - fetch the external-style sheet details
      * <p>Return will have no workbook set if it's actually in our own workbook</p>
+        * @return The found sheet
+        * @throws IllegalStateException If called with HSSF workbooks
      */
     ExternalSheet getExternalSheet(String firstSheetName, String lastSheetName, int externalWorkbookNumber);
     /**