com.univocity.parsers.common.iterators
Class RecordIterator
java.lang.Object
com.univocity.parsers.common.iterators.RecordIterator
- All Implemented Interfaces:
- IterableResult<Record,ParsingContext>, Iterable<Record>
public abstract class RecordIterator
- extends Object
An iterator of Records. Created when AbstractParser.iterateRecords(File)
(and its overloaded counterparts) is called
- Author:
- uniVocity Software Pty Ltd - dev@univocity.com
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
parser
protected final AbstractParser parser
RecordIterator
public RecordIterator(AbstractParser parser)
nextResult
protected final Record nextResult()
- Returns the next record (either a String[] or a
Record)
- Returns:
- the next record if available.
getContext
public final ParsingContext getContext()
- Description copied from interface:
IterableResult
- Returns the current parsing
Context, if available
- Specified by:
getContext in interface IterableResult<T,ParsingContext>
- Returns:
- the contextual object with information about an ongoing parsing process
beginParsing
protected abstract void beginParsing()
- This method is called whenever the
iterator is 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 as Reader, File, or InputStream without large code
reuse.
iterator
public final ResultIterator<T,ParsingContext> iterator()
- Specified by:
iterator in interface IterableResult<T,ParsingContext>- Specified by:
iterator in interface Iterable<T>
Copyright © 2017 uniVocity Software Pty Ltd. All rights reserved.