public class LineTracker
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
protected |
LineTracker()
Creates a new line tracker.
|
| Modifier and Type | Method and Description |
|---|---|
int |
computeNumberOfLines(java.lang.String text) |
java.lang.String |
getLineDelimiter(int line) |
IRegion |
getLineInformation(int line) |
IRegion |
getLineInformationOfOffset(int position) |
int |
getLineLength(int line) |
int |
getLineNumberOfOffset(int position) |
int |
getLineOffset(int line) |
int |
getNumberOfLines() |
int |
getNumberOfLines(int position,
int length) |
protected Document.DelimiterInfo |
nextDelimiterInfo(java.lang.String text,
int offset)
Returns the information about the first delimiter found in the given text
starting at the given offset.
|
void |
replace(int position,
int length,
java.lang.String text) |
void |
set(java.lang.String text) |
public final int getLineLength(int line)
throws BadLocationException
BadLocationExceptionpublic final int getLineNumberOfOffset(int position)
throws BadLocationException
BadLocationExceptionpublic final IRegion getLineInformationOfOffset(int position) throws BadLocationException
BadLocationExceptionpublic final IRegion getLineInformation(int line) throws BadLocationException
BadLocationExceptionpublic final int getLineOffset(int line)
throws BadLocationException
BadLocationExceptionpublic final int getNumberOfLines()
public final int getNumberOfLines(int position,
int length)
throws BadLocationException
BadLocationExceptionpublic final int computeNumberOfLines(java.lang.String text)
public final java.lang.String getLineDelimiter(int line)
throws BadLocationException
BadLocationExceptionprotected Document.DelimiterInfo nextDelimiterInfo(java.lang.String text, int offset)
text - the text to be searchedoffset - the offset in the given textnullpublic final void replace(int position,
int length,
java.lang.String text)
throws BadLocationException
BadLocationExceptionpublic final void set(java.lang.String text)