Package com.inet.excel.parser
Class SheetDimension
java.lang.Object
com.inet.excel.parser.SheetDimension
Immutable container for information about dimension of Excel sheet.
-
Constructor Summary
ConstructorsConstructorDescriptionSheetDimension(int firstColumnIndex, int lastColumnIndex) Creates new immutable container for information about dimension of Excel sheet. -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetColumnIndexFromCellRef(String cellRef) Returns index of column from specified cell reference.intReturns index of first column in sheet (inclusive).intReturns index of last column in sheet (inclusive).static SheetDimensionReturns instance representing information about dimension of excel sheet retrieved from provided reference.
-
Constructor Details
-
SheetDimension
public SheetDimension(int firstColumnIndex, int lastColumnIndex) Creates new immutable container for information about dimension of Excel sheet.- Parameters:
firstColumnIndex- index of first column in sheet (inclusive). Minimum value is 1.lastColumnIndex- index of last column in sheet (inclusive). Minimum value is 1.- Throws:
IllegalArgumentException- if one of specified indexes is smaller than 1; if first index is greater than last index.
-
-
Method Details
-
parse
Returns instance representing information about dimension of excel sheet retrieved from provided reference.- Parameters:
ref- reference to retrieve sheet dimension from.- Returns:
- instance representing information about dimension of excel sheet or null, in case of invalid reference.
-
getColumnIndexFromCellRef
Returns index of column from specified cell reference. In case of invalid cell reference, it will return zero. Examples of valid cell references: "A1", "A7", "G14", "BB44", "ASD1". Examples of invalid cell references: null, "", " ", "5", "$".- Parameters:
cellRef- cell reference to retrieve cell index from.- Returns:
- column index, starting from 1 (inclusive). In case of invalid cell reference, zero.
-
getFirstColumnIndex
public int getFirstColumnIndex()Returns index of first column in sheet (inclusive). Minimum value is 1.- Returns:
- index of first column in sheet.
-
getLastColumnIndex
public int getLastColumnIndex()Returns index of last column in sheet (inclusive). Minimum value is 1.- Returns:
- index of last column in sheet.
-