public abstract class Token extends java.lang.Object implements IToken
Modifier and Type | Field and Description |
---|---|
protected int |
lineNumber
Line number token was found at.
|
protected int |
offset
Number of characters before token in the resource it originates from
|
protected java.lang.String |
originId
Identifier of the resource this token originates from
|
protected java.lang.String |
text
Verbatim copy of the text found.
|
protected ETokenType |
type
Token type.
|
Modifier | Constructor and Description |
---|---|
protected |
Token(ETokenType type,
int offset,
int lineNumber,
java.lang.String text,
java.lang.String originId)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getEndOffset()
Get the number of characters before the end of this token in the text (i.e.
|
int |
getLineNumber()
Obtain number of line this token was found at.
|
int |
getOffset()
Get the number of characters before this token in the text.
|
java.lang.String |
getOriginId()
Get string that identifies the origin of this token.
|
java.lang.String |
getText()
Obtain the original input text for a token (copied verbatim from the source).
|
ETokenType |
getType()
Obtain type of token.
|
java.lang.String |
toString()
Obtain string representation of this token.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getLanguage, newToken
protected final ETokenType type
protected final int offset
protected final int lineNumber
protected final java.lang.String text
protected final java.lang.String originId
protected Token(ETokenType type, int offset, int lineNumber, java.lang.String text, java.lang.String originId)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getText()
public int getOffset()
public int getEndOffset()
getEndOffset
in interface IToken
public int getLineNumber()
getLineNumber
in interface IToken
public java.lang.String getOriginId()
getOriginId
in interface IToken
public ETokenType getType()