public class TokenizedDocument
extends java.lang.Object
SyntaxDocument
.Constructor and Description |
---|
TokenizedDocument(SyntaxDocument doc) |
Modifier and Type | Method and Description |
---|---|
void |
applySyntax()
Apply the syntax.
|
int |
countLines()
Return the number of lines in the document.
|
SyntaxDocument |
getSyntaxDocument()
Return the document.
|
java.lang.String |
getText()
Return the text of the document.
|
java.lang.String |
getText(PosToken token)
Return the text for a token.
|
java.util.SortedMap<java.lang.Integer,PosToken> |
getTokens() |
java.util.Iterator<PosToken> |
iterateAfter(int offset,
int id)
Iterate on the tokens of a specific id after an offset.
|
java.util.Iterator<PosToken> |
iterateBefore(int offset,
int id)
Iterate on the tokens of a specific id before an offset.
|
int |
length()
Return the length of the document.
|
void |
reset()
Resets the tokenized document.
|
java.util.List<PosToken> |
tokensAfter(int offset,
int id)
Return the tokens of a specific id after an offset.
|
java.util.List<PosToken> |
tokensBefore(int offset,
int id)
Return the tokens of a specific id before an offset.
|
public TokenizedDocument(SyntaxDocument doc)
public SyntaxDocument getSyntaxDocument()
public void reset()
public int countLines()
public int length()
public java.lang.String getText()
public java.util.SortedMap<java.lang.Integer,PosToken> getTokens()
public java.lang.String getText(PosToken token)
token
- the tokenpublic java.util.Iterator<PosToken> iterateBefore(int offset, int id)
offset
- the offset in the documentid
- the token id to search forpublic java.util.List<PosToken> tokensBefore(int offset, int id)
offset
- the offset in the documentid
- the token id to search forpublic java.util.Iterator<PosToken> iterateAfter(int offset, int id)
offset
- the offset in the documentid
- the token id to search forpublic java.util.List<PosToken> tokensAfter(int offset, int id)
offset
- the offset in the documentid
- the token id to search forpublic void applySyntax()
Copyright © 2016, 2017, 2018, 2019, 2023, 2025 Herve Girod. All Rights Reserved. Documentation and source under the MIT licence