public abstract class LexerOffsetsCache
extends java.lang.Object
| Constructor and Description | 
|---|
LexerOffsetsCache(LexerDocumentRenderer documentRenderer)
Constructs a new LexerOffsetsCache for the given style provider. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
int | 
findClosestOffset(Lexer lexer,
                 LexerToken lexerToken,
                 int offset)
Find the closest offset in the buffer we can start scanning from
 that occurs at or before the indicated offset. 
 | 
protected abstract int | 
findClosestOffsetInternal(Lexer lexer,
                         LexerToken lexerToken,
                         int offset)
Internal implementation of findClosestOffset() that does the
 real work. 
 | 
protected LexerDocumentRenderer | 
getDocumentRenderer()  | 
void | 
invalidateOffsets(int startOffset)
Invalidates all offsets larger than or equal to the given offset. 
 | 
protected abstract void | 
invalidateOffsetsInternal(int startOffset)  | 
public LexerOffsetsCache(LexerDocumentRenderer documentRenderer)
documentRenderer - the document renderer which mantains this cachepublic final int findClosestOffset(Lexer lexer, LexerToken lexerToken, int offset)
lexer - the (scratch) lexer to uselexerToken - the lexer token to useoffset - the maximum offset to findpublic final void invalidateOffsets(int startOffset)
startOffset - minimum offset to remove from the cacheprotected abstract int findClosestOffsetInternal(Lexer lexer, LexerToken lexerToken, int offset)
lexer - the (scratch) lexer to uselexerToken - the lexer token to useoffset - the maximum offset to findprotected abstract void invalidateOffsetsInternal(int startOffset)
protected final LexerDocumentRenderer getDocumentRenderer()