Package net.sf.basedb.util.parser
Class FlatFileParser.ExcelData
java.lang.Object
net.sf.basedb.util.parser.FlatFileParser.Data
net.sf.basedb.util.parser.FlatFileParser.ExcelData
- Enclosing class:
- FlatFileParser
Subclass that is used to return data when the source file is an Excel
file. It will forward all get() methods to retrieve the data directly
from the Cell item in Excel.
-
Field Summary
Modifier and TypeFieldDescriptionprivate final int
private final int
private final XlsxToCsvUtil.SheetInfo
-
Constructor Summary
ConstructorDescriptionExcelData
(XlsxToCsvUtil.SheetInfo sheet, int lineOffset, int lineNo, int dataLineNo, String line, String[] columns, boolean emptyIsNull, boolean nullIsNull, boolean trimWhiteSpace) Create a new data object. -
Method Summary
Modifier and TypeMethodDescriptionGet the value as a date.getDouble
(int index, NumberFormat parser, boolean nullIfException) Get the value as a double.getFloat
(int index, NumberFormat parser, boolean nullIfException) Get the value as a float.getInt
(int index, NumberFormat parser, boolean nullIfException) Get the value as an integer.getLong
(int index, NumberFormat parser, boolean nullIfException) Get the value as a long.getString
(int index) Get the value in the specified column.
-
Field Details
-
sheet
-
rowOffset
private final int rowOffset -
colOffset
private final int colOffset
-
-
Constructor Details
-
ExcelData
ExcelData(XlsxToCsvUtil.SheetInfo sheet, int lineOffset, int lineNo, int dataLineNo, String line, String[] columns, boolean emptyIsNull, boolean nullIsNull, boolean trimWhiteSpace) Create a new data object.
-
-
Method Details
-
getString
Description copied from class:FlatFileParser.Data
Get the value in the specified column.- Overrides:
getString
in classFlatFileParser.Data
- Parameters:
index
- The index for the column, starting at 0- Returns:
- The value in the column
-
getInt
Description copied from class:FlatFileParser.Data
Get the value as an integer. The default implementation parses the string value with the given parser. If the source file is an Excel file, the numeric value may be retrieved directly.- Overrides:
getInt
in classFlatFileParser.Data
-
getLong
Description copied from class:FlatFileParser.Data
Get the value as a long. The default implementation parses the string value with the given parser. If the source file is an Excel file, the numeric value may be retrieved directly.- Overrides:
getLong
in classFlatFileParser.Data
-
getFloat
Description copied from class:FlatFileParser.Data
Get the value as a float. The default implementation parses the string value with the given parser. If the source file is an Excel file, the numeric value may be retrieved directly.- Overrides:
getFloat
in classFlatFileParser.Data
-
getDouble
Description copied from class:FlatFileParser.Data
Get the value as a double. The default implementation parses the string value with the given parser. If the source file is an Excel file, the numeric value may be retrieved directly.- Overrides:
getDouble
in classFlatFileParser.Data
-
getDate
Description copied from class:FlatFileParser.Data
Get the value as a date. The default implementation parses the string value with the given parser. If the source file is an Excel file, the date value may be retrieved directly.- Overrides:
getDate
in classFlatFileParser.Data
-