|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cburch.editor.tokens.TokenizerEvent<T>
T - The type of token found in the tokenizer.public class TokenizerEvent<T extends BasicToken>
Describes information about a modification to the list of tokens maintained by the tokenizer. As an example of what the event describes, suppose that we had the following tokens.
a b c d e f g h
If the document were edited to remove d and
e the surrounding spaces, we would then have
a b cf g h
The TokenizerEvent describing this modification would
report that there was a modification beginning at index 2 (the
index of the first token removed), the list of tokens
removed is {c,d,e,f},
and the list of tokens added is {cf}.
The tokenizer tries to be quite conservative in the size of the changes reported; but for each document edit, it will never produce more than one event.
| Constructor Summary | |
|---|---|
TokenizerEvent(Tokenizer<T> source,
int rangeBegin,
java.util.List<T> oldTokens,
java.util.List<T> newTokens)
Constructs a description of a modification to a tokenizer's list of tokens. |
|
| Method Summary | |
|---|---|
int |
getFromIndex()
Returns the index of the token list where the modifications begin. |
java.util.List<T> |
getNewTokens()
Returns a segment of the list of tokens, all of which were inserted to the list at the given location. |
java.util.List<T> |
getOldTokens()
Returns a segment of the list of tokens, all of which were removed from the list. |
Tokenizer<T> |
getSource()
Returns the tokenizer that performed the modification. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TokenizerEvent(Tokenizer<T> source,
int rangeBegin,
java.util.List<T> oldTokens,
java.util.List<T> newTokens)
source - the tokenizer that initiated the event.rangeBegin - the index within the token list where the
replacement began.oldTokens - the tokens that were previously in the location.newTokens - the tokens that are now in the location.| Method Detail |
|---|
public Tokenizer<T> getSource()
public int getFromIndex()
public java.util.List<T> getOldTokens()
public java.util.List<T> getNewTokens()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||