public class Token
extends java.lang.Object
SyntaxDocument.getColors()
to get a color value and a length value which is
the length of the token in the text.Modifier and Type | Field and Description |
---|---|
static byte |
COMMENT1
Comment 1 token id.
|
static byte |
COMMENT2
Comment 2 token id.
|
static byte |
ID_COUNT
The total number of defined token ids.
|
static byte |
INTERNAL_FIRST
The first id that can be used for internal state in a token marker.
|
static byte |
INTERNAL_LAST
The last id that can be used for internal state in a token marker.
|
static byte |
INVALID
Invalid token id.
|
static byte |
KEYWORD1
Keyword 1 token id.
|
static byte |
KEYWORD2
Keyword 2 token id.
|
static byte |
KEYWORD3
Keyword 3 token id.
|
static byte |
LABEL
Label token id.
|
static byte |
LITERAL1
Literal 1 token id.
|
static byte |
LITERAL2
Literal 2 token id.
|
static byte |
NULL
Normal text token id.
|
static byte |
OPERATOR
Operator token id.
|
Constructor and Description |
---|
Token(int length,
byte id)
Creates a new token.
|
Modifier and Type | Method and Description |
---|---|
byte |
getId()
Returns the id of this token.
|
int |
getLength()
Returns the length of this token.
|
void |
setId(byte id)
Sets the id of this token.
|
void |
setLength(int length)
Sets the length of this token.
|
java.lang.String |
toString()
Returns a string representation of this token.
|
public static final byte NULL
public static final byte COMMENT1
public static final byte COMMENT2
public static final byte LITERAL1
public static final byte LITERAL2
public static final byte LABEL
public static final byte KEYWORD1
public static final byte KEYWORD2
public static final byte KEYWORD3
public static final byte OPERATOR
public static final byte INVALID
public static final byte ID_COUNT
public static final byte INTERNAL_FIRST
public static final byte INTERNAL_LAST
public Token(int length, byte id)
length
- the length of the tokenid
- the id of the tokenpublic java.lang.String toString()
toString
in class java.lang.Object
public byte getId()
public void setId(byte id)
id
- the new id of this tokenpublic int getLength()
public void setLength(int length)
length
- the new length of this token