Documentation of 'org.supercsv.io.AbstractTokenizer' Java class
AbstractTokenizer
org.supercsv.io

Class AbstractTokenizer

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, ITokenizer
    Direct Known Subclasses:
    Tokenizer


    public abstract class AbstractTokenizer
    extends java.lang.Object
    implements ITokenizer
    Defines the standard behaviour of a Tokenizer. Extend this class if you want the line-reading functionality of the default Tokenizer, but want to define your own implementation of ITokenizer.readColumns(List).
    Since:
    2.0.0
    • Constructor Summary

      Constructors 
      Constructor and Description
      AbstractTokenizer(java.io.Reader reader, CsvPreference preferences)
      Constructs a new AbstractTokenizer, which reads the CSV file, line by line.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void close()
      Closes the underlying reader.
      int getLineNumber()
      Gets the line number currently being tokenized (the first line is line 1).
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractTokenizer

        public AbstractTokenizer(java.io.Reader reader,
                                 CsvPreference preferences)
        Constructs a new AbstractTokenizer, which reads the CSV file, line by line.
        Parameters:
        reader - the reader
        preferences - the CSV preferences
        Throws:
        java.lang.NullPointerException - if reader or preferences is null
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Closes the underlying reader.
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.io.IOException
      • getLineNumber

        public int getLineNumber()
        Gets the line number currently being tokenized (the first line is line 1). This number increments at every line terminator as the data is read, i.e. it will be
        • 0, if ITokenizer.readColumns(List) hasn't been called yet
        • 1, when the first line is being read/tokenized
        • 2, when the second line is being read/tokenized
        Specified by:
        getLineNumber in interface ITokenizer
        Returns:
        the line number currently being tokenized

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.