Documentation of 'org.jfin.common.CSVFileFormatTokenizer' Java class
CSVFileFormatTokenizer
org.jfin.common

Class CSVFileFormatTokenizer



  • public class CSVFileFormatTokenizer
    extends java.lang.Object
    Class to parse a single line of a .csv file and break it down into a series of tokens.
    • Constructor Summary

      Constructors 
      Constructor and Description
      CSVFileFormatTokenizer(java.lang.String input)
      Constructor
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String[] getTokens()
      Utility method to allow quick conversion into an array of Strings.
      static java.lang.String[] getTokens(java.lang.String line)
      Utility static method to allow the quick conversion of a CSV formatted line into an array of Strings.
      boolean hasNext()
      Used to find if any more tokens are left to be parsed from the input String.
      void initialise(java.lang.String input)
      Initialises the CSVFormat object ready for parsing the new input string.
      java.lang.String next()
      Used to retrive the next token (or null if there are no more) as a String.
      byte nextByte() 
      byte nextByte(java.text.NumberFormat numberFormat) 
      java.util.Date nextDate() 
      java.util.Date nextDate(java.text.DateFormat dateFormat) 
      double nextDouble() 
      double nextDouble(java.text.NumberFormat numberFormat) 
      float nextFloat() 
      float nextFloat(java.text.NumberFormat numberFormat) 
      int nextInt() 
      int nextInt(java.text.NumberFormat numberFormat) 
      long nextLong() 
      long nextLong(java.text.NumberFormat numberFormat) 
      java.lang.Number nextNumber() 
      java.lang.Number nextNumber(java.text.NumberFormat numberFormat) 
      short nextShort() 
      short nextShort(java.text.NumberFormat numberFormat) 
      • Methods inherited from class java.lang.Object

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

      • CSVFileFormatTokenizer

        public CSVFileFormatTokenizer(java.lang.String input)
        Constructor
        Parameters:
        input - A String representing a line of CSV Formatted text
    • Method Detail

      • initialise

        public void initialise(java.lang.String input)
        Initialises the CSVFormat object ready for parsing the new input string.
        Parameters:
        input - A String representing a line of CSV Formatted text
      • hasNext

        public boolean hasNext()
        Used to find if any more tokens are left to be parsed from the input String.
        Returns:
        true if there are more tokens, otherwise false
      • next

        public java.lang.String next()
        Used to retrive the next token (or null if there are no more) as a String.

        If the original token was surrounded by quotes, for example if it contained commas, then the quotes are stripped.

        Returns:
        the next token as a String
      • getTokens

        public static java.lang.String[] getTokens(java.lang.String line)
        Utility static method to allow the quick conversion of a CSV formatted line into an array of Strings.
        Parameters:
        line - The CSV Formatted line to be parsed
        Returns:
        an array of String containing the tokens
      • getTokens

        public java.lang.String[] getTokens()
        Utility method to allow quick conversion into an array of Strings.
        Returns:
        an array of String containing the tokens
      • nextNumber

        public java.lang.Number nextNumber()
                                    throws java.text.ParseException
        Returns:
        the next token as a Number
        Throws:
        java.text.ParseException
      • nextNumber

        public java.lang.Number nextNumber(java.text.NumberFormat numberFormat)
                                    throws java.text.ParseException
        Parameters:
        numberFormat - The format to use to process the token
        Returns:
        the next token as a Number
        Throws:
        java.text.ParseException
      • nextDouble

        public double nextDouble()
                          throws java.text.ParseException
        Returns:
        the next token as a double
        Throws:
        java.text.ParseException
      • nextDouble

        public double nextDouble(java.text.NumberFormat numberFormat)
                          throws java.text.ParseException
        Parameters:
        numberFormat - The format to use to process the token
        Returns:
        the next token as a double
        Throws:
        java.text.ParseException
      • nextInt

        public int nextInt()
                    throws java.text.ParseException
        Returns:
        the next token as an int
        Throws:
        java.text.ParseException
      • nextInt

        public int nextInt(java.text.NumberFormat numberFormat)
                    throws java.text.ParseException
        Parameters:
        numberFormat - The format to use to process the token
        Returns:
        the next token as an int
        Throws:
        java.text.ParseException
      • nextLong

        public long nextLong()
                      throws java.text.ParseException
        Returns:
        the next token as a long
        Throws:
        java.text.ParseException
      • nextLong

        public long nextLong(java.text.NumberFormat numberFormat)
                      throws java.text.ParseException
        Parameters:
        numberFormat - The format to use to process the token
        Returns:
        the next token as a long
        Throws:
        java.text.ParseException
      • nextByte

        public byte nextByte()
                      throws java.text.ParseException
        Returns:
        the next token as a byte
        Throws:
        java.text.ParseException
      • nextByte

        public byte nextByte(java.text.NumberFormat numberFormat)
                      throws java.text.ParseException
        Parameters:
        numberFormat - The format to use to process the token
        Returns:
        the next token as a byte
        Throws:
        java.text.ParseException
      • nextShort

        public short nextShort()
                        throws java.text.ParseException
        Returns:
        the next token as a short
        Throws:
        java.text.ParseException
      • nextShort

        public short nextShort(java.text.NumberFormat numberFormat)
                        throws java.text.ParseException
        Parameters:
        numberFormat - The format to use to process the token
        Returns:
        the next token as a short
        Throws:
        java.text.ParseException
      • nextFloat

        public float nextFloat()
                        throws java.text.ParseException
        Returns:
        the next token as a float
        Throws:
        java.text.ParseException
      • nextFloat

        public float nextFloat(java.text.NumberFormat numberFormat)
                        throws java.text.ParseException
        Parameters:
        numberFormat - The format to use to process the token
        Returns:
        the next token as a float
        Throws:
        java.text.ParseException
      • nextDate

        public java.util.Date nextDate()
                                throws java.text.ParseException
        Returns:
        the next token as a Date
        Throws:
        java.text.ParseException
      • nextDate

        public java.util.Date nextDate(java.text.DateFormat dateFormat)
                                throws java.text.ParseException
        Parameters:
        dateFormat - The format to use to process the token
        Returns:
        the next token as a Date
        Throws:
        java.text.ParseException

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.