Package org.jparsec

Class Token

java.lang.Object
org.jparsec.Token

public final class Token extends Object
Represents any token with a token value and the 0-based index in the source.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
     
    private final int
     
    private final Object
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Token(int index, int length, Object value)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    private boolean
     
    int
     
    int
    Returns the index of the token in the original source.
    int
    Returns the length of the token.
    Returns the string representation of the token value.
    Returns the token value.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • ind

      private final int ind
    • len

      private final int len
    • value

      private final Object value
  • Constructor Details

    • Token

      public Token(int index, int length, Object value)
      Parameters:
      index - the starting index.
      length - the length of the token.
      value - the token value.
  • Method Details

    • length

      public int length()
      Returns the length of the token.
    • index

      public int index()
      Returns the index of the token in the original source.
    • value

      public Object value()
      Returns the token value.
    • toString

      public String toString()
      Returns the string representation of the token value.
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalToken

      private boolean equalToken(Token that)