public class TextRange extends java.lang.Object implements Segment, java.io.Serializable
ProperTextRange
,
Serialized FormModifier and Type | Field and Description |
---|---|
static TextRange[] |
EMPTY_ARRAY |
static TextRange |
EMPTY_RANGE |
BY_START_OFFSET_THEN_END_OFFSET
Modifier | Constructor and Description |
---|---|
|
TextRange(int startOffset,
int endOffset) |
protected |
TextRange(int startOffset,
int endOffset,
boolean checkForProperTextRange) |
Modifier and Type | Method and Description |
---|---|
static TextRange |
allOf(java.lang.String s) |
static boolean |
areSegmentsEqual(Segment segment1,
Segment segment2) |
static void |
assertProperRange(int startOffset,
int endOffset,
java.lang.Object message) |
static void |
assertProperRange(Segment range) |
static void |
assertProperRange(Segment range,
java.lang.Object message) |
boolean |
contains(int offset) |
boolean |
contains(Segment range) |
boolean |
contains(TextRange range) |
boolean |
containsOffset(int offset) |
boolean |
containsRange(int startOffset,
int endOffset) |
static boolean |
containsRange(Segment outer,
Segment inner) |
static TextRange |
create(int startOffset,
int endOffset) |
static TextRange |
create(Segment segment) |
TextRange |
cutOut(TextRange subRange) |
boolean |
equals(java.lang.Object obj) |
boolean |
equalsToRange(int startOffset,
int endOffset) |
static TextRange |
from(int offset,
int length) |
int |
getEndOffset() |
int |
getLength() |
int |
getStartOffset() |
TextRange |
grown(int lengthDelta) |
int |
hashCode() |
TextRange |
intersection(TextRange range) |
boolean |
intersects(int startOffset,
int endOffset) |
boolean |
intersects(Segment textRange) |
boolean |
intersects(TextRange textRange) |
boolean |
intersectsStrict(int startOffset,
int endOffset) |
boolean |
intersectsStrict(TextRange textRange) |
boolean |
isEmpty() |
java.lang.String |
replace(java.lang.String original,
java.lang.String replacement) |
TextRange |
shiftLeft(int delta) |
TextRange |
shiftRight(int delta) |
java.lang.CharSequence |
subSequence(java.lang.CharSequence str) |
java.lang.String |
substring(java.lang.String str) |
java.lang.String |
toString() |
TextRange |
union(TextRange textRange) |
public static final TextRange EMPTY_RANGE
public static final TextRange[] EMPTY_ARRAY
public TextRange(int startOffset, int endOffset)
create(int, int)
,
from(int, int)
,
allOf(String)
protected TextRange(int startOffset, int endOffset, boolean checkForProperTextRange)
checkForProperTextRange
- true
if offsets should be checked by assertProperRange(int, int, Object)
UnfairTextRange
public final int getStartOffset()
getStartOffset
in interface Segment
public final int getEndOffset()
getEndOffset
in interface Segment
public final int getLength()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean contains(TextRange range)
public boolean contains(Segment range)
public boolean containsRange(int startOffset, int endOffset)
public boolean containsOffset(int offset)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean contains(int offset)
public java.lang.String substring(java.lang.String str)
public java.lang.CharSequence subSequence(java.lang.CharSequence str)
public TextRange shiftRight(int delta)
public TextRange shiftLeft(int delta)
public TextRange grown(int lengthDelta)
public static TextRange from(int offset, int length)
public static TextRange create(int startOffset, int endOffset)
public java.lang.String replace(java.lang.String original, java.lang.String replacement)
public boolean intersects(TextRange textRange)
public boolean intersects(Segment textRange)
public boolean intersects(int startOffset, int endOffset)
public boolean intersectsStrict(TextRange textRange)
public boolean intersectsStrict(int startOffset, int endOffset)
public boolean isEmpty()
public boolean equalsToRange(int startOffset, int endOffset)
public static TextRange allOf(java.lang.String s)
public static void assertProperRange(Segment range) throws java.lang.AssertionError
java.lang.AssertionError
public static void assertProperRange(Segment range, java.lang.Object message) throws java.lang.AssertionError
java.lang.AssertionError
public static void assertProperRange(int startOffset, int endOffset, java.lang.Object message)