java.lang.Object
com.intellij.openapi.util.TextRange
- All Implemented Interfaces:
Segment,Serializable
A text range defined by start and end (exclusive) offset.
- See Also:
-
ProperTextRangecom.intellij.util.text.TextRangeUtil- Serialized Form
-
Field Summary
FieldsFields inherited from interface com.intellij.openapi.util.Segment
BY_START_OFFSET_THEN_END_OFFSET -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull TextRangestatic booleanareSegmentsEqual(@NotNull Segment segment1, @NotNull Segment segment2) static voidassertProperRange(int startOffset, int endOffset, @NotNull Object message) static voidassertProperRange(@NotNull Segment range) static voidassertProperRange(@NotNull Segment range, @NotNull Object message) booleancontains(int offset) booleanbooleanbooleancontainsOffset(int offset) booleancontainsRange(int startOffset, int endOffset) static booleancontainsRange(@NotNull Segment outer, @NotNull Segment inner) static @NotNull TextRangecreate(int startOffset, int endOffset) static @NotNull TextRange@NotNull TextRangebooleanbooleanequalsToRange(int startOffset, int endOffset) static @NotNull TextRangefrom(int offset, int length) final intfinal intfinal int@NotNull TextRangegrown(int lengthDelta) inthashCode()intersection(@NotNull TextRange range) booleanintersects(int startOffset, int endOffset) booleanintersects(@NotNull Segment textRange) booleanintersects(@NotNull TextRange textRange) booleanintersectsStrict(int startOffset, int endOffset) booleanintersectsStrict(@NotNull TextRange textRange) booleanisEmpty()static booleanisProperRange(int startOffset, int endOffset) @NotNull String@NotNull TextRangeshiftLeft(int delta) @NotNull TextRangeshiftRight(int delta) @NotNull CharSequencesubSequence(@NotNull CharSequence str) @NotNull StringtoString()@NotNull TextRange
-
Field Details
-
EMPTY_RANGE
-
EMPTY_ARRAY
-
-
Constructor Details
-
TextRange
@Contract(pure=true) public TextRange(int startOffset, int endOffset) - See Also:
-
TextRange
protected TextRange(int startOffset, int endOffset, boolean checkForProperTextRange) - Parameters:
checkForProperTextRange-trueif offsets should be checked byassertProperRange(int, int, Object)- See Also:
-
UnfairTextRange
-
-
Method Details
-
getStartOffset
public final int getStartOffset()- Specified by:
getStartOffsetin interfaceSegment
-
getEndOffset
public final int getEndOffset()- Specified by:
getEndOffsetin interfaceSegment
-
getLength
public final int getLength() -
equals
-
hashCode
public int hashCode() -
contains
-
contains
-
containsRange
public boolean containsRange(int startOffset, int endOffset) -
containsRange
-
containsOffset
public boolean containsOffset(int offset) -
toString
-
contains
public boolean contains(int offset) -
substring
-
subSequence
-
cutOut
-
shiftRight
-
shiftLeft
-
grown
-
from
-
create
@Contract(pure=true) @NotNull public static @NotNull TextRange create(int startOffset, int endOffset) -
create
-
areSegmentsEqual
-
replace
-
intersects
-
intersects
-
intersects
public boolean intersects(int startOffset, int endOffset) -
intersectsStrict
-
intersectsStrict
public boolean intersectsStrict(int startOffset, int endOffset) -
intersection
-
isEmpty
public boolean isEmpty() -
union
-
equalsToRange
public boolean equalsToRange(int startOffset, int endOffset) -
allOf
-
assertProperRange
- Throws:
AssertionError
-
assertProperRange
public static void assertProperRange(@NotNull @NotNull Segment range, @NotNull @NotNull Object message) throws AssertionError - Throws:
AssertionError
-
assertProperRange
public static void assertProperRange(int startOffset, int endOffset, @NotNull @NotNull Object message) -
isProperRange
public static boolean isProperRange(int startOffset, int endOffset)
-