Package org.fastnate.data.csv.properties
Class DataRow
java.lang.Object
org.fastnate.data.csv.properties.DataRow
A row from an import file.
Especially useful in CSV and table calculation files.
Don't keep a reference to this row in consumers, as it may be reused across different rows.
- Author:
- Tobias Liefke
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
DataRow
Creates a new instance of a container for row data.- Parameters:
columnNames- the header row with the column names
-
-
Method Details
-
getColumnCount
public int getColumnCount()The count of columns (according to the header).- Returns:
- the count of columns available
-
getName
The name of column at the given index.- Parameters:
columnIndex- the index of the column- Returns:
- the name of the column or the empty string ("") if no column exists at the given index
-
getValue
Reads the value of the column at the given index.- Parameters:
columnIndex- the index of the column- Returns:
- the value in that column or the empty string (""), if the column is empty or does not exist
-
getValue
Reads the value of the column with the given name.- Parameters:
columnName- the name of the column.- Returns:
- the value in that column or the empty string (""), if the column is empty or does not exist
-