public class CsvParserResult extends Object
This class contains all the information about the parsing: whether it was successful, an error message, the parsed data, the parsed header and the column type.
TODO: the error handling could be extended to include multiple error messages while still giving a best effort result (e.g. skipping the lines that can't be parsed).
Modifier and Type | Method and Description |
---|---|
List<String> |
getColumnNames()
The header of the CSV table.
|
List<Class<?>> |
getColumnTypes()
The type of data found in the column.
|
List<Object> |
getColumnValues()
The data of each column.
|
String |
getMessage()
An error message.
|
int |
getRowCount()
The number of rows.
|
boolean |
isParsingSuccessful()
True whether the parsing was successful and one can safely read
data from the data methods.
|
public List<String> getColumnNames()
public List<Object> getColumnValues()
Depending on the type, the data will be stored in a List
(for
Objects) and in a ListNumber
(for primitive data). For example,
if the column type is String
, then one can expect a List<String>
.
If it's double
, then one can expect a ListDouble
.
public List<Class<?>> getColumnTypes()
At present, it can be either String
or double
.
public int getRowCount()
public boolean isParsingSuccessful()
public String getMessage()
Copyright © 2015. All rights reserved.