jsyntaxpane
public class Token extends java.lang.Object implements java.io.Serializable, java.lang.Comparable
Modifier and Type | Field and Description |
---|---|
short |
kind
The kind of the Document.
|
int |
length |
byte |
pairValue
the pair value to use if this token is one of a pair:
This is how it is used:
The openning part will have a positive number X
The closing part will have a negative number X
X should be unique for a pair:
e.g.
|
int |
start |
TokenType |
type |
Constructor and Description |
---|
Token(TokenType type,
int start,
int length)
Constructs a new token
|
Token(TokenType type,
int start,
int length,
byte pairValue)
Construct a new part of pair token
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object o) |
int |
end()
return the end position of the token.
|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getString(javax.swing.text.Document doc) |
java.lang.CharSequence |
getText(javax.swing.text.Document doc)
Get the text of the token from this document
|
int |
hashCode() |
java.lang.String |
toString() |
public final TokenType type
public final int start
public final int length
public final byte pairValue
public final short kind
public Token(TokenType type, int start, int length)
type
- start
- length
- public Token(TokenType type, int start, int length, byte pairValue)
type
- start
- length
- pairValue
- public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public int end()
public java.lang.CharSequence getText(javax.swing.text.Document doc)
doc
- public java.lang.String getString(javax.swing.text.Document doc)