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 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)