public class TestableCSVReader
extends java.lang.Object
| Constructor and Description |
|---|
TestableCSVReader(java.lang.String path) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.commons.csv.CSVRecord |
get(int index)
Get a row from the file by index (zero based).
|
org.apache.commons.csv.CSVRecord |
next()
Gets the next row in the CSV file.
|
org.apache.commons.csv.CSVRecord |
next(boolean wrap)
Gets the next row in the CSV file.
|
java.util.List<org.apache.commons.csv.CSVRecord> |
next(int rows)
Gets the next 1 or more rows from the CSV file.
|
java.util.List<org.apache.commons.csv.CSVRecord> |
next(int rows,
boolean wrap)
Gets the next 1 or more rows from the CSV file.
|
org.apache.commons.csv.CSVRecord |
random()
Get a random row from the file.
|
public TestableCSVReader(java.lang.String path)
throws java.io.IOException
java.io.IOExceptionpublic org.apache.commons.csv.CSVRecord get(int index)
index - The row index to load. The first row in the file after the header row is row 0.public org.apache.commons.csv.CSVRecord random()
public org.apache.commons.csv.CSVRecord next()
throws java.io.IOException
java.io.IOExceptionpublic org.apache.commons.csv.CSVRecord next(boolean wrap)
throws java.io.IOException
wrap - If true once the last row is reached loop back to the first row. If false a
ClientProtocolException is thrown when the end of the file is reached.java.io.IOExceptionpublic java.util.List<org.apache.commons.csv.CSVRecord> next(int rows)
throws java.io.IOException
rows - Number of rows to returnjava.io.IOExceptionpublic java.util.List<org.apache.commons.csv.CSVRecord> next(int rows,
boolean wrap)
throws java.io.IOException
rows - Number of rows to returnwrap - If true once the last row is reached loop back to the first row. If false a
ClientProtocolException is thrown when the end of the file is reached.java.io.IOException