Class RowIterator
- java.lang.Object
-
- com.univocity.parsers.common.iterators.RowIterator
-
- All Implemented Interfaces:
IterableResult<java.lang.String[],ParsingContext>,java.lang.Iterable<java.lang.String[]>
public abstract class RowIterator extends java.lang.ObjectAn iterator ofString[]. Created whenAbstractParser.iterate(File)(and its overloaded counterparts) is called- Author:
- Univocity Software Pty Ltd - dev@univocity.com
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractParserparser
-
Constructor Summary
Constructors Constructor Description RowIterator(AbstractParser parser)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidbeginParsing()This method is called whenever theiteratoris starting to iterate over the results.ParsingContextgetContext()Returns the current parsingContext, if availableResultIterator<T,ParsingContext>iterator()protected java.lang.String[]nextResult()Returns the next record (either a String[] or aRecord)
-
-
-
Field Detail
-
parser
protected final AbstractParser parser
-
-
Constructor Detail
-
RowIterator
public RowIterator(AbstractParser parser)
-
-
Method Detail
-
nextResult
protected final java.lang.String[] nextResult()
Returns the next record (either a String[] or aRecord)- Returns:
- the next record if available.
-
getContext
public final ParsingContext getContext()
Description copied from interface:IterableResultReturns the current parsingContext, if available- Specified by:
getContextin interfaceIterableResult<T,ParsingContext>- Returns:
- the contextual object with information about an ongoing parsing process
-
beginParsing
protected abstract void beginParsing()
This method is called whenever theiteratoris starting to iterate over the results. an example implementation of this is:
@Override public void beginParsing(){ parser.beginParsing(input); }
This is to allow for different input types such asReader, File, or InputStreamwithout large code reuse.
-
iterator
public final ResultIterator<T,ParsingContext> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<T>- Specified by:
iteratorin interfaceIterableResult<T,ParsingContext>
-
-