|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jsyntaxpane.Token
public class Token
A Token in a Document. Tokens do NOT store a reference to the underlying SyntaxDocument, and must generally be obtained from the SyntaxDocument methods. The reason for not storing the SyntaxDocument is simply for memory, as the number of Tokens per document can be large, you may end up with twice the memory in a SyntaxDocument with Tokens than a simple PlainDocument.
Field Summary | |
---|---|
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. for [ pairValue = +1 for ] pairValue = -1 |
int |
start
|
TokenType |
type
|
Constructor Summary | |
---|---|
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 |
Method Summary | |
---|---|
int |
compareTo(Token t)
|
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()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final TokenType type
public final int start
public final int length
public final byte pairValue
public final short kind
Constructor Detail |
---|
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
- Method Detail |
---|
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(Token t)
compareTo
in interface java.lang.Comparable<Token>
public int end()
public java.lang.CharSequence getText(javax.swing.text.Document doc)
doc
-
public java.lang.String getString(javax.swing.text.Document doc)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |