Package org.eclipse.jface.text
Interface ITextStore
- All Known Implementing Classes:
CopyOnWriteTextStore
,GapTextStore
,SequentialRewriteTextStore
public interface ITextStore
Interface for storing and managing text.
Provides access to the stored text and allows to manipulate it.
Clients may
implement this interface or use GapTextStore
or
CopyOnWriteTextStore
.
-
Method Summary
Modifier and TypeMethodDescriptionchar
get
(int offset) Returns the character at the specified offset.get
(int offset, int length) Returns the text of the specified character range.int
Returns number of characters stored in this text store.void
Replaces the specified character range with the given text.void
Replace the content of the text store with the given text.
-
Method Details
-
get
char get(int offset) Returns the character at the specified offset.- Parameters:
offset
- the offset in this text store- Returns:
- the character at this offset
-
get
Returns the text of the specified character range.- Parameters:
offset
- the offset of the rangelength
- the length of the range- Returns:
- the text of the range
-
getLength
int getLength()Returns number of characters stored in this text store.- Returns:
- the number of characters stored in this text store
-
replace
Replaces the specified character range with the given text.replace(getLength(), 0, "some text")
is a valid call and appends text to the end of the text store.- Parameters:
offset
- the offset of the range to be replacedlength
- the number of characters to be replacedtext
- the substitution text
-
set
Replace the content of the text store with the given text. Convenience method forreplace(0, getLength(), text
.- Parameters:
text
- the new content of the text store
-