public class Token
extends java.lang.Object
Constructor and Description |
---|
Token() |
Modifier and Type | Method and Description |
---|---|
int |
getLineNumber()
Returns the line of this token in the original text.
|
int |
getPosition()
Returns the position of this token in the original input text.
|
java.lang.String |
getPostpunctuation()
Returns the postpunctuation characters of this Token.
|
java.lang.String |
getPrepunctuation()
Returns the prepunctuation characters of this Token.
|
java.lang.String |
getWhitespace()
Returns the whitespace characters of this Token.
|
java.lang.String |
getWord()
Returns the string associated with this token.
|
void |
setLineNumber(int lineNumber)
Set the line of this token in the original text.
|
void |
setPosition(int position)
Sets the position of the token in the original input text.
|
void |
setPostpunctuation(java.lang.String postpunctuation)
Sets the postpunctuation characters of this Token.
|
void |
setPrepunctuation(java.lang.String prepunctuation)
Sets the prepunctuation characters of this Token.
|
void |
setWhitespace(java.lang.String whitespace)
Sets the whitespace characters of this Token.
|
void |
setWord(java.lang.String word)
Sets the string of this Token.
|
java.lang.String |
toString()
Converts this token to a string.
|
public java.lang.String getWhitespace()
public java.lang.String getPrepunctuation()
public java.lang.String getPostpunctuation()
public int getPosition()
public int getLineNumber()
public void setWhitespace(java.lang.String whitespace)
whitespace
- the whitespace character for this tokenpublic void setPrepunctuation(java.lang.String prepunctuation)
prepunctuation
- the prepunctuation characterspublic void setPostpunctuation(java.lang.String postpunctuation)
postpunctuation
- the postpunctuation characterspublic void setPosition(int position)
position
- the position of the input textpublic void setLineNumber(int lineNumber)
lineNumber
- the line of this token in the original textpublic java.lang.String getWord()
public void setWord(java.lang.String word)
word
- the word for this tokenpublic java.lang.String toString()
toString
in class java.lang.Object