public class TextRange
extends java.lang.Object
implements java.lang.Comparable
Constructor and Description |
---|
TextRange(TextBuffer buffer,
int startOffset,
int endOffset)
Create a text range for a section of the text buffer.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object o) |
boolean |
contains(int offset) |
void |
dispose()
Free up resources used to track this range in the buffer.
|
int |
getEndOffset() |
int |
getLength() |
int |
getStartOffset() |
java.lang.String |
getText() |
java.lang.String |
toString() |
public TextRange(TextBuffer buffer, int startOffset, int endOffset)
buffer
- startOffset
- the first offset to be included in the rangeendOffset
- the last offset to be included in the rangepublic void dispose()
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public int getStartOffset()
public int getEndOffset()
public int getLength()
public boolean contains(int offset)
offset
- public java.lang.String getText() throws java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsException
public java.lang.String toString()
toString
in class java.lang.Object