public class TextDocument
extends java.lang.Object
Constructor and Description |
---|
TextDocument(java.lang.String text) |
Modifier and Type | Method and Description |
---|---|
java.lang.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.
|
java.lang.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.
|
java.lang.String |
getText(java.lang.String lineDelimiter)
Returns the original text with converted line delimiters.
|
public int getNumberOfLines()
public int getLineOffset(int line)
line
- the line of interestpublic int getLineLength(int line)
line
- the line of interestpublic java.lang.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 java.lang.String getLineText(int line, boolean includeDelimiter)
line
- includeDelimiter
- specifies whether to include a line delimiterpublic int getSmartLineStart(int offset)
offset
- public java.lang.String getText(java.lang.String lineDelimiter)
lineDelimiter
- Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.