Class LineArrayTextReader

  • All Implemented Interfaces:
    Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, SizeOfHandler, Serializable

    public class LineArrayTextReader
    extends AbstractTextReaderWithEncoding<String[]>
    Reads the text in as array of strings (each line is an array element).
    For large files, the data can be 'chunked' (ie outputting it in blocks).

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -encoding <adams.core.base.BaseCharset> (property: encoding)
        The type of encoding to use when reading the file, use empty string for 
        default.
        default: Default
     
    -chunk-size <int> (property: chunkSize)
        The maximum number of lines per chunk; using -1 will read put all data into 
        a single array.
        default: -1
        minimum: -1
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_ChunkSize

        protected int m_ChunkSize
        the chunk size to use.
      • m_Scanner

        protected transient Scanner m_Scanner
        the scanner in use.
    • Constructor Detail

      • LineArrayTextReader

        public LineArrayTextReader()
    • Method Detail

      • setChunkSize

        public void setChunkSize​(int value)
        Sets the maximum chunk size.
        Parameters:
        value - the size of the chunks, < 1 denotes infinity
      • getChunkSize

        public int getChunkSize()
        Returns the current chunk size.
        Returns:
        the size of the chunks, < 1 denotes infinity
      • chunkSizeTipText

        public String chunkSizeTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the gui
      • doNext

        public String[] doNext()
        Returns the next lot of data.
        Specified by:
        doNext in class AbstractTextReader<String[]>
        Returns:
        the next amount of data, null if failed to read