public class Token
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
Token(java.lang.String name)
Constructor that sets all attributes of a token
|
Token(java.lang.String name,
int start_byte,
int end_byte)
Constructor that sets all attributes of a token
|
Modifier and Type | Method and Description |
---|---|
int |
end_byte()
Provides the ending byte location of this token
|
boolean |
equals(java.lang.Object tokenObject)
Override the equals so that comparison is based on the name
|
int |
hashCode()
Override the hashcode method so it will sort on name
|
java.lang.String |
name()
Provides the token name
|
int |
start_byte()
Provides the starting byte location of this token
|
java.lang.String |
toString() |
public Token(java.lang.String name, int start_byte, int end_byte)
name
- the string name of the tokenstart_byte
- the int
value of the first byte of this token; set to -1 if no information is availableend_byte
- the int
value of the last byte of this token; set to -1 if no information is availablepublic Token(java.lang.String name)
name
- the string name of the tokenpublic java.lang.String name()
public int start_byte()
int
value of the first byte of this tokenpublic int end_byte()
int
value of the last byte of this tokenpublic java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object tokenObject)
equals
in class java.lang.Object