public class CSVDataSource<T extends Output<T>> extends ColumnarDataSource<T>
DataSource
for loading separable data from a text file (e.g., CSV, TSV)
and applying FieldProcessor
s to it.Modifier and Type | Class and Description |
---|---|
static class |
CSVDataSource.CSVDataSourceProvenance
Provenance for
CSVDataSource . |
outputRequired, rowProcessor
Constructor and Description |
---|
CSVDataSource(Path dataPath,
RowProcessor<T> rowProcessor,
boolean outputRequired)
Creates a CSVDataSource using the specified RowProcessor to process the data.
|
CSVDataSource(Path dataPath,
RowProcessor<T> rowProcessor,
boolean outputRequired,
char separator)
Creates a CSVDataSource using the specified RowProcessor to process the data.
|
CSVDataSource(Path dataPath,
RowProcessor<T> rowProcessor,
boolean outputRequired,
char separator,
char quote)
Creates a CSVDataSource using the specified RowProcessor to process the data, and the supplied separator and quote
characters to read the input data file.
|
CSVDataSource(URI dataFile,
RowProcessor<T> rowProcessor,
boolean outputRequired)
Creates a CSVDataSource using the specified RowProcessor to process the data.
|
CSVDataSource(URI dataFile,
RowProcessor<T> rowProcessor,
boolean outputRequired,
char separator)
Creates a CSVDataSource using the specified RowProcessor to process the data.
|
CSVDataSource(URI dataFile,
RowProcessor<T> rowProcessor,
boolean outputRequired,
char separator,
char quote)
Creates a CSVDataSource using the specified RowProcessor to process the data, and the supplied separator and quote
characters to read the input data file.
|
Modifier and Type | Method and Description |
---|---|
ConfiguredDataSourceProvenance |
getProvenance() |
void |
postConfig()
Used by the OLCUT configuration system, and should not be called by external code.
|
ColumnarIterator |
rowIterator()
The iterator that emits
ColumnarIterator.Row objects from the
underlying data source. |
String |
toString() |
getMetadataTypes, getOutputFactory, iterator
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public CSVDataSource(Path dataPath, RowProcessor<T> rowProcessor, boolean outputRequired)
Uses ',' as the separator, '"' as the quote character, and '\' as the escape character.
dataPath
- The Path to the data file.rowProcessor
- The row processor which converts a row into an Example
.outputRequired
- Is the output required to exist in the data file.public CSVDataSource(URI dataFile, RowProcessor<T> rowProcessor, boolean outputRequired)
Uses ',' as the separator, '"' as the quote character, and '\' as the escape character.
dataFile
- A URI for the data file.rowProcessor
- The row processor which converts a row into an Example
.outputRequired
- Is the output required to exist in the data file.public CSVDataSource(Path dataPath, RowProcessor<T> rowProcessor, boolean outputRequired, char separator)
Uses '"' as the quote character, and '\' as the escape character.
dataPath
- The Path to the data file.rowProcessor
- The row processor which converts a row into an Example
.outputRequired
- Is the output required to exist in the data file.separator
- The separator character in the data file.public CSVDataSource(URI dataFile, RowProcessor<T> rowProcessor, boolean outputRequired, char separator)
Uses '"' as the quote character, and '\' as the escape character.
dataFile
- A URI for the data file.rowProcessor
- The row processor which converts a row into an Example
.outputRequired
- Is the output required to exist in the data file.separator
- The separator character in the data file.public CSVDataSource(URI dataFile, RowProcessor<T> rowProcessor, boolean outputRequired, char separator, char quote)
dataFile
- A URI for the data file.rowProcessor
- The row processor which converts a row into an Example
.outputRequired
- Is the output required to exist in the data file.separator
- The separator character in the data file.quote
- The quote character in the data file.public CSVDataSource(Path dataPath, RowProcessor<T> rowProcessor, boolean outputRequired, char separator, char quote)
dataPath
- The Path to the data file.rowProcessor
- The row processor which converts a row into an Example
.outputRequired
- Is the output required to exist in the data file.separator
- The separator character in the data file.quote
- The quote character in the data file.public void postConfig()
public ColumnarIterator rowIterator()
ColumnarDataSource
ColumnarIterator.Row
objects from the
underlying data source.rowIterator
in class ColumnarDataSource<T extends Output<T>>
public ConfiguredDataSourceProvenance getProvenance()
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.