Interface TokenFactory

All Known Implementing Classes:
DefaultTokenFactory

interface TokenFactory
Interface for a class that generates tokens somehow.
Version:
0.1
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a null token.
    createToken(char[] line, int beg, int end, int startOffset, int type)
    Returns a token.
    createToken(Segment line, int beg, int end, int startOffset, int type)
    Returns a token.
    void
    Resets the state of this token maker.
  • Method Details

    • createToken

      TokenImpl createToken()
      Returns a null token.
      Returns:
      A null token.
    • createToken

      TokenImpl createToken(Segment line, int beg, int end, int startOffset, int type)
      Returns a token.
      Parameters:
      line - The segment from which to get the token's text.
      beg - The starting offset of the token's text in the segment.
      end - The ending offset of the token's text in the segment.
      startOffset - The offset in the document of the token.
      type - The type of token.
      Returns:
      The token.
    • createToken

      TokenImpl createToken(char[] line, int beg, int end, int startOffset, int type)
      Returns a token.
      Parameters:
      line - The char array from which to get the token's text.
      beg - The starting offset of the token's text in the char array.
      end - The ending offset of the token's text in the char array.
      startOffset - The offset in the document of the token.
      type - The type of token.
      Returns:
      The token.
    • resetAllTokens

      void resetAllTokens()
      Resets the state of this token maker. This method should be called by the TokenMaker every time a token list is generated for a new line so the tokens can be reused.