Package org.jparsec

Class Token


  • public final class Token
    extends java.lang.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 int ind  
      private int len  
      private java.lang.Object value  
    • Constructor Summary

      Constructors 
      Constructor Description
      Token​(int index, int length, java.lang.Object value)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      private boolean equalToken​(Token that)  
      int hashCode()  
      int index()
      Returns the index of the token in the original source.
      int length()
      Returns the length of the token.
      java.lang.String toString()
      Returns the string representation of the token value.
      java.lang.Object value()
      Returns the token value.
      • Methods inherited from class java.lang.Object

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

      • ind

        private final int ind
      • len

        private final int len
      • value

        private final java.lang.Object value
    • Constructor Detail

      • Token

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

      • 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 java.lang.Object value()
        Returns the token value.
      • toString

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

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • equalToken

        private boolean equalToken​(Token that)