|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmarf.nlp.Parsing.Token
public class Token
This class denotes a Token data structure.
$Id: Token.java,v 1.22 2008/01/03 03:21:57 mokhov Exp $
| Field Summary | |
|---|---|
protected double |
dNumericalValue
Numerical value associated with the token to be mapped to StreamTokenizer.nval |
protected java.awt.Point |
oPosition
Line and column where the token occurred. |
protected TokenSubType |
oTokenType
Token type. |
private static long |
serialVersionUID
For serialization versioning. |
protected java.lang.String |
strLexeme
Spelling of the token. |
| Constructor Summary | |
|---|---|
Token(java.lang.String pstrLexeme,
int piLineNumber,
int piTokenType,
double pdNumericalValue)
Constructor that maps values produced by StreamTokenizer. |
|
Token(java.lang.String pstrLexeme,
java.awt.Point poPosition,
TokenSubType poTokenType)
Constructor with full parameters. |
|
Token(Token poToken)
Copy-constructor. |
|
| Method Summary | |
|---|---|
java.lang.String |
getLexeme()
Allows accessing the lexeme property. |
int |
getLineNumber()
Gets the line number component of the token's position. |
static java.lang.String |
getMARFSourceCodeRevision()
Retrieves class' revision. |
double |
getNumericalValue()
Gets the numerical representation of the token. |
java.awt.Point |
getPosition()
Allows accessing position property. |
TokenSubType |
getTokenType()
Allows accessing the token type. |
boolean |
serialize(int piOperation,
java.io.FileWriter poFileWriter)
Loads/saves the token to a text file. |
void |
setLexeme(java.lang.String pstrLexeme)
Sets the value of the lexeme property. |
void |
setPosition(java.awt.Point poPosition)
Sets the value of the new position of the token. |
void |
setTokenType(TokenSubType poTokenType)
Sets the value of the token type. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String strLexeme
protected java.awt.Point oPosition
protected TokenSubType oTokenType
protected double dNumericalValue
StreamTokenizer.nvalprivate static final long serialVersionUID
serialver tool that comes with JDK.
| Constructor Detail |
|---|
public Token(java.lang.String pstrLexeme,
java.awt.Point poPosition,
TokenSubType poTokenType)
pstrLexeme - token's lexemepoPosition - position in the sourcepoTokenType - type of a token
public Token(java.lang.String pstrLexeme,
int piLineNumber,
int piTokenType,
double pdNumericalValue)
pstrLexeme - token's lexemepiLineNumber - line number of the tokenpiTokenType - type of a tokenpdNumericalValue - numerical value of the tokenStreamTokenizerpublic Token(Token poToken)
poToken - token to clone data members from.| Method Detail |
|---|
public boolean serialize(int piOperation,
java.io.FileWriter poFileWriter)
piOperation - load or savepoFileWriter - file writer object to use
public java.lang.String getLexeme()
public void setLexeme(java.lang.String pstrLexeme)
pstrLexeme - the new value of the lexeme propertypublic java.awt.Point getPosition()
public void setPosition(java.awt.Point poPosition)
poPosition - the new value of the position propertypublic int getLineNumber()
public double getNumericalValue()
public TokenSubType getTokenType()
public void setTokenType(TokenSubType poTokenType)
poTokenType - the new value of the TokenTypepublic static java.lang.String getMARFSourceCodeRevision()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||