public class CSVReader.OpenedCSVFile extends Object implements AutoCloseable
Constructor and Description |
---|
OpenedCSVFile() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
String[] |
getHeaders()
The header-names of the CSV file if available.
|
boolean |
hasHeaders()
Does the first line of the CSV file specify headers rather than values?
|
Optional<String[]> |
readLine()
Reads the next-line from the open CSV file.
|
void |
setNumberColumns(int numberColumns)
Sets the number of columns, if it is already known from elsewhere.
|
public Optional<String[]> readLine() throws IOException
Optional.empty()
if there are no more lines to read.IOException
- if any problem occurs access the file.public void close() throws CSVReaderException
close
in interface AutoCloseable
CSVReaderException
public boolean hasHeaders()
public String[] getHeaders()
null
if no headers are
available.public void setNumberColumns(int numberColumns)
If no number has been assigned (or -1) it is automatically determined when reading the CSV file.
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.