public final class TokenChange<T extends TokenId> extends Object
TokenChange.embeddedChange(int)
.
Modifier and Type | Method and Description |
---|---|
int |
addedTokenCount()
Get number of the tokens added by this token change.
|
TokenSequence<T> |
currentTokenSequence()
Get the token sequence that corresponds to the current state
of the token hierarchy.
|
TokenChange<?> |
embeddedChange(int index)
Get embedded change at the given index.
|
int |
embeddedChangeCount()
Get number of embedded changes contained in this change.
|
int |
index()
Get index of the first token being modified.
|
boolean |
isBoundsChange()
Whether this change only modifies bounds of a single token.
|
Language<T> |
language()
Get the language describing token ids
used by tokens contained in this token change.
|
LanguagePath |
languagePath()
Get the complete language path of the tokens contained
in this token sequence (containing outer language levels as well).
|
int |
offset()
Get offset of the first token that was modified.
|
int |
removedTokenCount()
Get number of removed tokens contained in this token change.
|
TokenSequence<T> |
removedTokenSequence()
Create token sequence over the removed tokens.
|
String |
toString() |
public int embeddedChangeCount()
public TokenChange<?> embeddedChange(int index)
index
- 0 <= index <= embeddedChangeCount() index of the embedded change.public Language<T> language()
public LanguagePath languagePath()
public int index()
public int offset()
public int removedTokenCount()
public TokenSequence<T> removedTokenSequence()
There is no analogy of this method for the added tokens.
The TokenChange.currentTokenSequence()
may be used for exploration
of the current token sequence at this level.
public int addedTokenCount()
public TokenSequence<T> currentTokenSequence()
TokenChange.index()
.
public boolean isBoundsChange()