Class Range
- java.lang.Object
-
- com.vladsch.flexmark.util.sequence.Range
-
- Direct Known Subclasses:
TagRange
public class Range extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description BasedSequence
basedSafeSubSequence(java.lang.CharSequence charSequence)
BasedSequence
basedSubSequence(java.lang.CharSequence charSequence)
java.lang.CharSequence
charSubSequence(java.lang.CharSequence charSequence)
int
compare(Range other)
int
component1()
int
component2()
boolean
contains(int index)
boolean
contains(int start, int end)
boolean
contains(Range other)
boolean
doesContain(int index)
boolean
doesContain(int start, int end)
boolean
doesContain(Range other)
boolean
doesNotOverlap(Range other)
boolean
doesNotOverlapNorAdjacent(Range other)
boolean
doesNotOverlapOrAdjacent(Range other)
boolean
doesOverlap(Range other)
boolean
doesOverlapOrAdjacent(Range other)
boolean
doesProperlyContain(Range other)
static Range
emptyOf(int position)
Range
endMinus(int delta)
Range
endPlus(int delta)
boolean
equals(java.lang.Object o)
Range
exclude(Range other)
Range
expandToInclude(int start, int end)
Range
expandToInclude(Range other)
int
getEnd()
int
getEndOffset()
int
getSpan()
int
getStart()
int
getStartOffset()
int
hashCode()
Range
include(int pos)
Range
include(int start, int end)
Range
include(Range other)
Range
intersect(Range other)
boolean
isAdjacent(int index)
boolean
isAdjacent(Range other)
boolean
isAdjacentAfter(int index)
boolean
isAdjacentAfter(Range other)
boolean
isAdjacentBefore(int index)
boolean
isAdjacentBefore(Range other)
boolean
isContainedBy(int start, int end)
boolean
isContainedBy(Range other)
boolean
isEmpty()
boolean
isEnd(int index)
boolean
isEqual(Range other)
boolean
isLast(int index)
boolean
isNotEmpty()
boolean
isNotNull()
boolean
isNull()
boolean
isProperlyContainedBy(int start, int end)
boolean
isProperlyContainedBy(Range other)
boolean
isStart(int index)
boolean
isValidIndex(int index)
boolean
leadBy(int index)
boolean
leads(int index)
static Range
of(int start, int end)
static Range
ofLength(int start, int length)
boolean
overlaps(Range other)
boolean
overlapsOrAdjacent(Range other)
boolean
properlyContains(Range other)
RichSequence
richSafeSubSequence(java.lang.CharSequence charSequence)
RichSequence
richSubSequence(java.lang.CharSequence charSequence)
java.lang.CharSequence
safeSubSequence(java.lang.CharSequence charSequence)
Range
shiftLeft(int delta)
Range
shiftRight(int delta)
Range
startMinus(int delta)
Range
startPlus(int delta)
BasedSequence
subSequence(java.lang.CharSequence charSequence)
Deprecated.usebasedSubSequence(CharSequence)
insteadjava.lang.String
toString()
boolean
trailedBy(int index)
boolean
trails(int index)
Range
withEnd(int end)
Range
withRange(int start, int end)
Range
withStart(int start)
-
-
-
Constructor Detail
-
Range
protected Range(int start, int end)
Create range- Parameters:
start
- startend
- end
-
Range
@NotNull protected Range(@NotNull Range other)
-
-
Method Detail
-
of
@NotNull public static Range of(int start, int end)
-
emptyOf
@NotNull public static Range emptyOf(int position)
-
ofLength
@NotNull public static Range ofLength(int start, int length)
-
getStart
public int getStart()
-
getEnd
public int getEnd()
-
component1
public int component1()
-
component2
public int component2()
-
getStartOffset
public int getStartOffset()
-
getEndOffset
public int getEndOffset()
-
withStart
public Range withStart(int start)
-
withEnd
public Range withEnd(int end)
-
endMinus
public Range endMinus(int delta)
-
endPlus
public Range endPlus(int delta)
-
startMinus
public Range startMinus(int delta)
-
startPlus
public Range startPlus(int delta)
-
withRange
public Range withRange(int start, int end)
-
shiftLeft
public Range shiftLeft(int delta)
-
shiftRight
public Range shiftRight(int delta)
-
getSpan
public int getSpan()
-
isNull
public boolean isNull()
-
isNotNull
public boolean isNotNull()
-
isEmpty
public boolean isEmpty()
-
isNotEmpty
public boolean isNotEmpty()
-
contains
public boolean contains(@NotNull Range other)
-
doesContain
public boolean doesContain(@NotNull Range other)
-
contains
public boolean contains(int index)
-
doesContain
public boolean doesContain(int index)
-
contains
public boolean contains(int start, int end)
-
doesContain
public boolean doesContain(int start, int end)
-
overlaps
public boolean overlaps(@NotNull Range other)
-
doesOverlap
public boolean doesOverlap(@NotNull Range other)
-
doesNotOverlap
public boolean doesNotOverlap(@NotNull Range other)
-
overlapsOrAdjacent
public boolean overlapsOrAdjacent(@NotNull Range other)
-
doesOverlapOrAdjacent
public boolean doesOverlapOrAdjacent(@NotNull Range other)
-
doesNotOverlapOrAdjacent
public boolean doesNotOverlapOrAdjacent(@NotNull Range other)
-
doesNotOverlapNorAdjacent
public boolean doesNotOverlapNorAdjacent(@NotNull Range other)
-
properlyContains
public boolean properlyContains(@NotNull Range other)
-
doesProperlyContain
public boolean doesProperlyContain(@NotNull Range other)
-
isAdjacent
public boolean isAdjacent(int index)
-
isAdjacentAfter
public boolean isAdjacentAfter(int index)
-
isAdjacentBefore
public boolean isAdjacentBefore(int index)
-
isAdjacent
public boolean isAdjacent(@NotNull Range other)
-
isAdjacentBefore
public boolean isAdjacentBefore(@NotNull Range other)
-
isAdjacentAfter
public boolean isAdjacentAfter(@NotNull Range other)
-
isContainedBy
public boolean isContainedBy(@NotNull Range other)
-
isContainedBy
public boolean isContainedBy(int start, int end)
-
isProperlyContainedBy
public boolean isProperlyContainedBy(@NotNull Range other)
-
isProperlyContainedBy
public boolean isProperlyContainedBy(int start, int end)
-
isEqual
public boolean isEqual(@NotNull Range other)
-
isValidIndex
public boolean isValidIndex(int index)
-
isStart
public boolean isStart(int index)
-
isEnd
public boolean isEnd(int index)
-
isLast
public boolean isLast(int index)
-
leadBy
public boolean leadBy(int index)
-
leads
public boolean leads(int index)
-
trailedBy
public boolean trailedBy(int index)
-
trails
public boolean trails(int index)
-
compare
public int compare(@NotNull Range other)
-
include
@NotNull public Range include(int pos)
-
include
@NotNull public Range include(int start, int end)
-
expandToInclude
@NotNull public Range expandToInclude(int start, int end)
-
subSequence
@NotNull @Deprecated public BasedSequence subSequence(@NotNull java.lang.CharSequence charSequence)
Deprecated.usebasedSubSequence(CharSequence)
insteadReturn a based subsequence of sequence given by this range- Parameters:
charSequence
- char sequence from which to extract the range- Returns:
- resulting based subsequence
-
basedSubSequence
@NotNull public BasedSequence basedSubSequence(@NotNull java.lang.CharSequence charSequence)
-
basedSafeSubSequence
@NotNull public BasedSequence basedSafeSubSequence(@NotNull java.lang.CharSequence charSequence)
-
richSubSequence
@NotNull public RichSequence richSubSequence(@NotNull java.lang.CharSequence charSequence)
-
richSafeSubSequence
@NotNull public RichSequence richSafeSubSequence(@NotNull java.lang.CharSequence charSequence)
-
charSubSequence
@NotNull public java.lang.CharSequence charSubSequence(@NotNull java.lang.CharSequence charSequence)
-
safeSubSequence
@NotNull public java.lang.CharSequence safeSubSequence(@NotNull java.lang.CharSequence charSequence)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-