| java.lang.Object org.netbeans.lib.lexer.EmbeddingContainer
EmbeddingContainer | final public class EmbeddingContainer (Code) | | Embedding info contains information about all the embeddings
for a particular token in a token list.
There can be one or more
EmbeddedTokenList instances for each
cotnained embedding.
There is an intent to not degrade performance significantly
with each extra language embedding level so the token list maintains direct
link to the root level.
author: Miloslav Metelka version: 1.00 |
Method Summary | |
public void | addEmbeddedTokenList(EmbeddedTokenList> prevEtl, EmbeddedTokenList> etl, boolean defaultEmbedding) Add a new embedded token list to this container. | public int | cachedModCount() | public char | charAt(int tokenRelOffset) | public void | checkStatusUpdated() Check if this embedding container is up-to-date (updateStatusImpl() was called on it)
which is useful for missing-update-status checks. | public static boolean | createEmbedding(TokenList<T> tokenList, int index, Language<ET> embeddedLanguage, int startSkipLength, int endSkipLength, boolean joinSections) Create custom embedding.
Parameters: tokenList - non-null token list in which the token for which the embeddingshould be created resides. Parameters: index - >=0 index of the token in the token list where the embeddingshould be created. Parameters: embeddedLanguage - non-null embedded language. Parameters: startSkipLength - >=0 number of characters in an initial part of the tokenfor which the language embedding is being create that should be excludedfrom the embedded section. | public EmbeddedTokenList> | defaultEmbeddedTokenList() | public static EmbeddedTokenList<ET> | embeddedTokenList(TokenList<T> tokenList, int index, Language<ET> embeddedLanguage) Get embedded token list.
Parameters: tokenList - non-null token list in which the token for which the embeddingshould be obtained resides. Parameters: index - >=0 index of the token in the token list where the embeddingshould be obtained. Parameters: language - whether only language embeddding of the particular languagewas requested. | public EmbeddedTokenList> | firstEmbeddedTokenList() | void | invalidateChildren() | public boolean | isRemoved() Check whether this embedding container is no longer present
in the token hierarchy. | public void | reinit(AbstractToken<T> token) Make this container serve a different token. | public EmbeddedTokenList> | removeEmbeddedTokenList(EmbeddedTokenList> prevEtl, EmbeddedTokenList> etl) Remove embedded token list from this container.
Clear reference to next item in the removed token list.
Parameters: prevEtl - token list preceding the place of removal.Null means that the removed one is first in the chain. Parameters: etl - non-null token list to be removed. | public static boolean | removeEmbedding(TokenList<T> tokenList, int index, Language<ET> embeddedLanguage) | public AbstractToken> | rootToken() | public TokenList> | rootTokenList() | public int | rootTokenOffsetShift() | public AbstractToken<T> | token() | public int | tokenStartOffset() | public boolean | updateStatus() | public void | updateStatusAndInvalidate() | public AbstractToken> | updateStatusImpl() Update and return root token corresponding to this embedding container. |
EmbeddingContainer | EmbeddingContainer(EmbeddingContainer<T> ec)(Code) | | Constructor used when a custom embedding gets removed.
Such removal does not increase token hierarchy version
(to not destroy existing token sequences) but need to invalidate
token sequences over the removed embedded token list and all its children.
A new special embedding container gets created in such case
that will carry null root token since begining and will have a special modCount
so that the token sequences become invalid.
Parameters: ec - non-null existing embedding container. |
addEmbeddedTokenList | public void addEmbeddedTokenList(EmbeddedTokenList> prevEtl, EmbeddedTokenList> etl, boolean defaultEmbedding)(Code) | | Add a new embedded token list to this container.
Parameters: prevEtl - token list preceding the place of addition.Null means that the added one will be first in the chain. Parameters: etl - non-null token list to be added. Parameters: defaultEmbedding - whether the added etl is default embedding or not. |
cachedModCount | public int cachedModCount()(Code) | | |
charAt | public char charAt(int tokenRelOffset)(Code) | | |
checkStatusUpdated | public void checkStatusUpdated()(Code) | | Check if this embedding container is up-to-date (updateStatusImpl() was called on it)
which is useful for missing-update-status checks.
|
createEmbedding | public static boolean createEmbedding(TokenList<T> tokenList, int index, Language<ET> embeddedLanguage, int startSkipLength, int endSkipLength, boolean joinSections)(Code) | | Create custom embedding.
Parameters: tokenList - non-null token list in which the token for which the embeddingshould be created resides. Parameters: index - >=0 index of the token in the token list where the embeddingshould be created. Parameters: embeddedLanguage - non-null embedded language. Parameters: startSkipLength - >=0 number of characters in an initial part of the tokenfor which the language embedding is being create that should be excludedfrom the embedded section. The excluded characters will not be lexedand there will be no tokens created for them. Parameters: endSkipLength - >=0 number of characters at the end of the tokenfor which the language embedding is defined that should be excludedfrom the embedded section. The excluded characters will not be lexedand there will be no tokens created for them. |
embeddedTokenList | public static EmbeddedTokenList<ET> embeddedTokenList(TokenList<T> tokenList, int index, Language<ET> embeddedLanguage)(Code) | | Get embedded token list.
Parameters: tokenList - non-null token list in which the token for which the embeddingshould be obtained resides. Parameters: index - >=0 index of the token in the token list where the embeddingshould be obtained. Parameters: language - whether only language embeddding of the particular languagewas requested. It may be null if any embedding should be returned. |
invalidateChildren | void invalidateChildren()(Code) | | |
isRemoved | public boolean isRemoved()(Code) | | Check whether this embedding container is no longer present
in the token hierarchy.
This method should only be called after updateStatusImpl() was called
(it updates rootToken variable).
|
reinit | public void reinit(AbstractToken<T> token)(Code) | | Make this container serve a different token.
The updateStatusImpl() should be called afterwards to update tokenStartOffset etc.
|
removeEmbeddedTokenList | public EmbeddedTokenList> removeEmbeddedTokenList(EmbeddedTokenList> prevEtl, EmbeddedTokenList> etl)(Code) | | Remove embedded token list from this container.
Clear reference to next item in the removed token list.
Parameters: prevEtl - token list preceding the place of removal.Null means that the removed one is first in the chain. Parameters: etl - non-null token list to be removed. next token list linked originally to etl. |
removeEmbedding | public static boolean removeEmbedding(TokenList<T> tokenList, int index, Language<ET> embeddedLanguage)(Code) | | |
rootTokenOffsetShift | public int rootTokenOffsetShift()(Code) | | |
tokenStartOffset | public int tokenStartOffset()(Code) | | |
updateStatus | public boolean updateStatus()(Code) | | |
updateStatusAndInvalidate | public void updateStatusAndInvalidate()(Code) | | |
updateStatusImpl | public AbstractToken> updateStatusImpl()(Code) | | Update and return root token corresponding to this embedding container.
|
|
|