|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectscanner.Token
Tokens are objects created by a scanner while scanning a stream of characters.
Constructor Summary | |
Token(java.lang.String val,
TokenType type,
CharStreamPosition position)
Creates a new token with the specified values. |
Method Summary | |
int |
getLength()
Returns the length of this positionable object. |
CharStreamPosition |
getPosition()
Returns the position of this token. |
TokenType |
getType()
Returns the type of this token. |
java.lang.String |
getValue()
Returns the string of this token. |
java.lang.String |
toString()
Returns a string representation of this token. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Token(java.lang.String val, TokenType type, CharStreamPosition position)
val
- The token value.type
- The type of this tokenposition
- The position of this token : equals to the position
of the first character of this token.Method Detail |
public TokenType getType()
public java.lang.String getValue()
public int getLength()
PositionableInCharStream
getLength
in interface PositionableInCharStream
public CharStreamPosition getPosition()
getPosition
in interface PositionableInCharStream
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |