com.singularsys.jep.configurableparser.tokens

## Class Token

- java.lang.Object
- - com.singularsys.jep.configurableparser.tokens.Token

- All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    CommentToken, FunctionToken, IdentifierToken, MultiLineToken, NumberToken, OperatorToken, StringToken, SymbolToken, TerminatorToken, WhiteSpaceToken

      public abstract class Token
      extends java.lang.Object
      implements java.io.Serializable

  Base class for tokens. Different token types should subclass this class.
  Author:
    Richard Morris
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Token(java.lang.String source)` Create a token.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object arg)`
    `int` | `getColumnNumber()`
    `int` | `getLength()` Gets the length of the source text matched by this token
    `int` | `getLineNumber()`
    `java.lang.String` | `getSource()` Gets the source text matched by this token
    `int` | `hashCode()`
    `boolean` | `isBinary()`
    `boolean` | `isComment()`
    `boolean` | `isFunction()`
    `boolean` | `isIdentifier()`
    `boolean` | `isImplicitMulRhs()` Whether the token can appear on the right hand side of implicit multiplication '2 x'.
    `boolean` | `isNumber()`
    `boolean` | `isOperator()`
    `boolean` | `isPrefix()`
    `boolean` | `isString()`
    `boolean` | `isSuffix()`
    `boolean` | `isSymbol()`
    `boolean` | `isTerminal()`
    `boolean` | `isTernary()`
    `boolean` | `isWhiteSpace()`
    `void` | `setPosition(int line, int column)` Sets the position of the token.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Token

          public Token(java.lang.String source)

      Create a token. Generally this methods should not be used, but is does have application with the `MultiLineMatcher`.
      Parameters:
        `source` -

  - ### Method Detail

    - #### getSource

          public java.lang.String getSource()

      Gets the source text matched by this token
      Returns:
        the source text

    - #### getLength

          public int getLength()

      Gets the length of the source text matched by this token
      Returns:
        the length of the source

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### isWhiteSpace

          public boolean isWhiteSpace()

    - #### isIdentifier

          public boolean isIdentifier()

    - #### isFunction

          public boolean isFunction()

    - #### isOperator

          public boolean isOperator()

    - #### isBinary

          public boolean isBinary()

    - #### isPrefix

          public boolean isPrefix()

    - #### isSuffix

          public boolean isSuffix()

    - #### isTernary

          public boolean isTernary()

    - #### isNumber

          public boolean isNumber()

    - #### isComment

          public boolean isComment()

    - #### isString

          public boolean isString()

    - #### isSymbol

          public boolean isSymbol()

    - #### isImplicitMulRhs

          public boolean isImplicitMulRhs()

      Whether the token can appear on the right hand side of implicit multiplication '2 x'.
      Returns:
        boolean value corresponding to the result.

    - #### equals

          public boolean equals(java.lang.Object arg)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### isTerminal

          public boolean isTerminal()

    - #### setPosition

          public void setPosition(int line,
                                  int column)

      Sets the position of the token. By convention numbering starts from line 1 column 1.
      Parameters:
        `line` - line number
        `column` - column number

    - #### getLineNumber

          public int getLineNumber()

    - #### getColumnNumber

          public int getColumnNumber()

Copyright © 2018 Singular Systems http://www.singularsys.com/jep