public class CSVIterator extends ColumnarIterator implements AutoCloseable
ColumnarIterator.Row
Spliterator.OfDouble, Spliterator.OfInt, Spliterator.OfLong, Spliterator.OfPrimitive<T,T_CONS,T_SPLITR extends Spliterator.OfPrimitive<T,T_CONS,T_SPLITR>>
Modifier and Type | Field and Description |
---|---|
static char |
QUOTE
Default quote character.
|
static char |
SEPARATOR
Default separator character.
|
currentRow, fields
DEFAULT_BATCH_SIZE, DEFAULT_CHARACTERISTICS
CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED
Constructor and Description |
---|
CSVIterator(Reader rdr)
Builds a CSVIterator for the supplied Reader.
|
CSVIterator(Reader rdr,
char separator,
char quote)
Builds a CSVIterator for the supplied Reader.
|
CSVIterator(Reader rdr,
char separator,
char quote,
List<String> fields)
Builds a CSVIterator for the supplied Reader.
|
CSVIterator(Reader rdr,
char separator,
char quote,
String[] fields)
Builds a CSVIterator for the supplied Reader.
|
CSVIterator(URI dataFile)
Builds a CSVIterator for the supplied URI.
|
CSVIterator(URI dataFile,
char separator,
char quote)
Builds a CSVIterator for the supplied URI.
|
CSVIterator(URI dataFile,
char separator,
char quote,
List<String> fields)
Builds a CSVIterator for the supplied URI.
|
CSVIterator(URI dataFile,
char separator,
char quote,
String[] fields)
Builds a CSVIterator for the supplied URI.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected Optional<ColumnarIterator.Row> |
getRow()
Returns the next row of data based on internal state stored by the implementor, or
Optional.empty()
if there is no more data. |
forEachRemaining, getFields, hasNext, next, tryAdvance
characteristics, estimateSize, trySplit
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getComparator, getExactSizeIfKnown, hasCharacteristics
public static final char SEPARATOR
public static final char QUOTE
public CSVIterator(Reader rdr)
SEPARATOR
for the separator
and QUOTE
for the quote.rdr
- The source to read.public CSVIterator(Reader rdr, char separator, char quote)
rdr
- The source to read.separator
- The separator character to use.quote
- The quote character to use.public CSVIterator(URI dataFile) throws IOException
SEPARATOR
for the separator
and QUOTE
for the quote.dataFile
- The source to read.IOException
- thrown if the file is not readable in some way.public CSVIterator(URI dataFile, char separator, char quote) throws IOException
dataFile
- The source to read.separator
- The separator character to use.quote
- The quote character to use.IOException
- thrown if the file is not readable in some way.public CSVIterator(URI dataFile, char separator, char quote, String[] fields) throws IOException
dataFile
- The source to read.separator
- The separator character to use.quote
- The quote character to use.fields
- The headers to use.IOException
- thrown if the file is not readable in some way.public CSVIterator(URI dataFile, char separator, char quote, List<String> fields) throws IOException
dataFile
- The source to read.separator
- The separator character to use.quote
- The quote character to use.fields
- The headers to use.IOException
- thrown if the file is not readable in some way.public CSVIterator(Reader rdr, char separator, char quote, String[] fields)
rdr
- The source to read.separator
- The separator character to use.quote
- The quote character to use.fields
- The headers to use.public CSVIterator(Reader rdr, char separator, char quote, List<String> fields)
rdr
- The source to read.separator
- The separator character to use.quote
- The quote character to use.fields
- The headers to use.protected Optional<ColumnarIterator.Row> getRow()
ColumnarIterator
Optional.empty()
if there is no more data.getRow
in class ColumnarIterator
public void close() throws IOException
close
in interface AutoCloseable
IOException
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.