org.codehaus.jparsec
Class Token

java.lang.Object
  extended by org.codehaus.jparsec.Token

public final class Token
extends Object

Represents any token with a token value and the 0-based index in the source.

Author:
Ben Yu

Constructor Summary
Token(int index, int length, Object value)
           
 
Method Summary
 boolean equals(Object obj)
           
 int hashCode()
           
 int index()
          Returns the index of the token in the original source.
 int length()
          Returns the length of the token.
 String toString()
          Returns the string representation of the token value.
 Object value()
          Returns the token value.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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


Copyright © 2014. All rights reserved.