Class CSVTokenStream

java.lang.Object
ca.phon.csv.CSVTokenStream

public class CSVTokenStream extends Object
A tokenizer and queue of tokens as read from a CSV file.
Author:
Cristopher Yates
  • Constructor Details

    • CSVTokenStream

      public CSVTokenStream(Reader reader, CSVQuoteType quoteType, char[] separators)
      Constructs a new CSVTokenStream.
      Parameters:
      reader - The reader for reading the data from a specified file or buffer.
      quoteType - An enum for which type of quote character is being used.
      separators - An array of characters that act as separators in the CSV.
  • Method Details

    • nextToken

      public CSVToken nextToken()
      Gets the next token from the queue.
      Returns:
      The next token from the queue.
    • LA

      public ca.phon.csv.CSVTokenType LA(int n)
      Get the type of the token n spaces ahead in the queue without removing it.
      Parameters:
      n - The number of places in the queue to look ahead.
      Returns:
      The type of the token at position n - 1 ≈ in the queue.
    • LT

      public CSVToken LT(int n)
      Get the token n spaces ahead in the queue without removing it.
      Parameters:
      n - The number of places in the queue to look ahead.
      Returns:
      The token at position n - 1 in the queue.
    • add

      public boolean add(CSVToken token)