com.univocity.parsers.common.iterators
Class RowIterator

java.lang.Object
  extended by com.univocity.parsers.common.iterators.RowIterator
All Implemented Interfaces:
IterableResult<String[],ParsingContext>, Iterable<String[]>

public abstract class RowIterator
extends Object

An iterator of String[]. Created when AbstractParser.iterate(File) (and its overloaded counterparts) is called

Author:
uniVocity Software Pty Ltd - dev@univocity.com

Field Summary
protected  AbstractParser parser
           
 
Constructor Summary
RowIterator(AbstractParser parser)
           
 
Method Summary
protected abstract  void beginParsing()
          This method is called whenever the iterator is starting to iterate over the results.
 ParsingContext getContext()
          Returns the current parsing Context, if available
 ResultIterator<T,ParsingContext> iterator()
           
protected  String[] nextResult()
          Returns the next record (either a String[] or a Record)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parser

protected final AbstractParser parser
Constructor Detail

RowIterator

public RowIterator(AbstractParser parser)
Method Detail

nextResult

protected final String[] 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:
     &#064;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 © 2018 uniVocity Software Pty Ltd. All rights reserved.