public class TextDocument extends Object
Constructor and Description |
---|
TextDocument(String text) |
Modifier and Type | Method and Description |
---|---|
String |
getLineDelimiter(int line)
Returns the line delimiter of the given line.
|
int |
getLineLength(int line)
Returns the length of the given line including the line's delimiter.
|
int |
getLineOffset(int line)
Determines the offset of the first character of the given line.
|
int |
getLineOfOffset(int offset)
Returns the number of the line at which the character of the specified
position is located.
|
String |
getLineText(int line,
boolean includeDelimiter)
Returns a text of the line given by its line number.
|
int |
getNumberOfLines()
Returns the number of lines in this document
|
int |
getSmartLineStart(int offset)
Returns the offset of the smart line start.
|
String |
getText(String lineDelimiter)
Returns the original text with converted line delimiters.
|
public TextDocument(String text)
text
- public int getNumberOfLines()
public int getLineOffset(int line)
line
- the line of interestpublic int getLineLength(int line)
line
- the line of interestpublic String getLineDelimiter(int line)
The method returns null
for the last line.
line
- the line of interestnull
public int getLineOfOffset(int offset)
offset
- the document offsetpublic String getLineText(int line, boolean includeDelimiter)
line
- includeDelimiter
- specifies whether to include a line delimiterpublic int getSmartLineStart(int offset)
offset
- Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.