Class RecordIterator


  • public class RecordIterator
    extends java.lang.Object
    Record Iterator for reading large files Note: this is a memory intensive and will not handle files that exceed memory.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Close.
      protected static ModelRecord findModelForLine​(java.lang.String line, int lineNum, ModelDataFile modelDataFile)
      Searches through the record models to find one with a matching type-code, if no type-code exists that model will always be used if it gets to it
      int getCurrentLineNumber()
      Gets current line number.
      protected boolean getNextLine()
      Gets next line.
      boolean hasNext()
      Has next boolean.
      Record next()
      Next record.
      protected void setupStream​(java.io.InputStream dataFileStream, java.lang.String locationInfo)
      Sets stream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • setupStream

        protected void setupStream​(java.io.InputStream dataFileStream,
                                   java.lang.String locationInfo)
                            throws DataFileException
        Sets stream.
        Parameters:
        dataFileStream - the data file stream
        locationInfo - the location info
        Throws:
        DataFileException - the data file exception
      • getCurrentLineNumber

        public int getCurrentLineNumber()
        Gets current line number.
        Returns:
        the current line number
      • hasNext

        public boolean hasNext()
        Has next boolean.
        Returns:
        the boolean
      • findModelForLine

        protected static ModelRecord findModelForLine​(java.lang.String line,
                                                      int lineNum,
                                                      ModelDataFile modelDataFile)
                                               throws DataFileException
        Searches through the record models to find one with a matching type-code, if no type-code exists that model will always be used if it gets to it
        Parameters:
        line -
        lineNum -
        modelDataFile -
        Returns:
        return the ModelRecord Object found
        Throws:
        DataFileException - Exception thown for various errors, generally has a nested exception