Top Fields Constructors Methods
com.vladsch.flexmark.util.sequence

public Class Range

extends Object
Class Inheritance
Known Direct Subclasses
com.vladsch.flexmark.util.sequence.TagRange
Imports
org.jetbrains.annotations.NotNull

Field Summary

Modifier and TypeField and Description
public static final Range
private final int
public static final Range
private final int

Constructor Summary

AccessConstructor and Description
protected
Range(int
start
start
,
int
end
end
)

Create range

protected

Method Summary

Modifier and TypeMethod and Description
public @NotNull BasedSequence
public @NotNull BasedSequence
public @NotNull CharSequence
public int
public int
public int
public boolean
public boolean
contains(int index)

public boolean
contains(int start, int end)

public boolean
public boolean
doesContain(int index)

public boolean
doesContain(int start, int end)

public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public static @NotNull Range
emptyOf(int position)

public Range
endMinus(int delta)

public Range
endPlus(int delta)

public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public @NotNull Range
public @NotNull Range
public @NotNull Range
expandToInclude(int start, int end)

public int
public int
public int
public int
public int
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public @NotNull Range
public @NotNull Range
include(int pos)

public @NotNull Range
include(int start, int end)

public @NotNull Range
public boolean
isAdjacent(int index)

public boolean
public boolean
isAdjacentAfter(int index)

public boolean
public boolean
isAdjacentBefore(int index)

public boolean
public boolean
public boolean
isContainedBy(int start, int end)

public boolean
public boolean
isEnd(int index)

public boolean
public boolean
isLast(int index)

public boolean
public boolean
public boolean
public boolean
public boolean
isProperlyContainedBy(int start, int end)

public boolean
isStart(int index)

public boolean
isValidIndex(int index)

public boolean
leadBy(int index)

public boolean
leads(int index)

public static @NotNull Range
of(int start, int end)

public static @NotNull Range
ofLength(int start, int length)

public boolean
public boolean
public boolean
public @NotNull RichSequence
public @NotNull RichSequence
public @NotNull CharSequence
public Range
shiftLeft(int delta)

public Range
shiftRight(int delta)

public Range
startMinus(int delta)

public Range
startPlus(int delta)

public @NotNull BasedSequence

Returns:

resulting based subsequence
subSequence
(@NotNull CharSequence
char sequence from which to extract the range
charSequence
)
Deprecated use basedSubSequence(CharSequence) instead

Return a based subsequence of sequence given by this range

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public boolean
trailedBy(int index)

public boolean
trails(int index)

public Range
withEnd(int end)

public Range
withRange(int start, int end)

public Range
withStart(int start)

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

EMPTYback to summary
public static final Range EMPTY
endback to summary
private final int end
NULLback to summary
public static final Range NULL
startback to summary
private final int start

Constructor Detail

Rangeback to summary
protected Range(int start, int end)

Create range

Parameters
start:int

start

end:int

end

Rangeback to summary
protected Range(@NotNull Range other)

Method Detail

basedSafeSubSequenceback to summary
public @NotNull BasedSequence basedSafeSubSequence(@NotNull CharSequence charSequence)
Annotations
@NotNull
basedSubSequenceback to summary
public @NotNull BasedSequence basedSubSequence(@NotNull CharSequence charSequence)
Annotations
@NotNull
charSubSequenceback to summary
public @NotNull CharSequence charSubSequence(@NotNull CharSequence charSequence)
Annotations
@NotNull
compareback to summary
public int compare(@NotNull Range other)
component1back to summary
public int component1()
component2back to summary
public int component2()
containsback to summary
public boolean contains(@NotNull Range other)
containsback to summary
public boolean contains(int index)
containsback to summary
public boolean contains(int start, int end)
doesContainback to summary
public boolean doesContain(@NotNull Range other)
doesContainback to summary
public boolean doesContain(int index)
doesContainback to summary
public boolean doesContain(int start, int end)
doesNotOverlapback to summary
public boolean doesNotOverlap(@NotNull Range other)
doesNotOverlapNorAdjacentback to summary
public boolean doesNotOverlapNorAdjacent(@NotNull Range other)
doesNotOverlapOrAdjacentback to summary
public boolean doesNotOverlapOrAdjacent(@NotNull Range other)
doesOverlapback to summary
public boolean doesOverlap(@NotNull Range other)
doesOverlapOrAdjacentback to summary
public boolean doesOverlapOrAdjacent(@NotNull Range other)
doesProperlyContainback to summary
public boolean doesProperlyContain(@NotNull Range other)
emptyOfback to summary
public static @NotNull Range emptyOf(int position)
Annotations
@NotNull
endMinusback to summary
public Range endMinus(int delta)
endPlusback to summary
public Range endPlus(int delta)
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
excludeback to summary
public @NotNull Range exclude(@NotNull Range other)
Annotations
@NotNull
expandToIncludeback to summary
public @NotNull Range expandToInclude(@NotNull Range other)
Annotations
@NotNull
expandToIncludeback to summary
public @NotNull Range expandToInclude(int start, int end)
Annotations
@NotNull
getEndback to summary
public int getEnd()
getEndOffsetback to summary
public int getEndOffset()
getSpanback to summary
public int getSpan()
getStartback to summary
public int getStart()
getStartOffsetback to summary
public int getStartOffset()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
includeback to summary
public @NotNull Range include(@NotNull Range other)
Annotations
@NotNull
includeback to summary
public @NotNull Range include(int pos)
Annotations
@NotNull
includeback to summary
public @NotNull Range include(int start, int end)
Annotations
@NotNull
intersectback to summary
public @NotNull Range intersect(@NotNull Range other)
Annotations
@NotNull
isAdjacentback to summary
public boolean isAdjacent(int index)
isAdjacentback to summary
public boolean isAdjacent(@NotNull Range other)
isAdjacentAfterback to summary
public boolean isAdjacentAfter(int index)
isAdjacentAfterback to summary
public boolean isAdjacentAfter(@NotNull Range other)
isAdjacentBeforeback to summary
public boolean isAdjacentBefore(int index)
isAdjacentBeforeback to summary
public boolean isAdjacentBefore(@NotNull Range other)
isContainedByback to summary
public boolean isContainedBy(@NotNull Range other)
isContainedByback to summary
public boolean isContainedBy(int start, int end)
isEmptyback to summary
public boolean isEmpty()
isEndback to summary
public boolean isEnd(int index)
isEqualback to summary
public boolean isEqual(@NotNull Range other)
isLastback to summary
public boolean isLast(int index)
isNotEmptyback to summary
public boolean isNotEmpty()
isNotNullback to summary
public boolean isNotNull()
isNullback to summary
public boolean isNull()
isProperlyContainedByback to summary
public boolean isProperlyContainedBy(@NotNull Range other)
isProperlyContainedByback to summary
public boolean isProperlyContainedBy(int start, int end)
isStartback to summary
public boolean isStart(int index)
isValidIndexback to summary
public boolean isValidIndex(int index)
leadByback to summary
public boolean leadBy(int index)
leadsback to summary
public boolean leads(int index)
ofback to summary
public static @NotNull Range of(int start, int end)
Annotations
@NotNull
ofLengthback to summary
public static @NotNull Range ofLength(int start, int length)
Annotations
@NotNull
overlapsback to summary
public boolean overlaps(@NotNull Range other)
overlapsOrAdjacentback to summary
public boolean overlapsOrAdjacent(@NotNull Range other)
properlyContainsback to summary
public boolean properlyContains(@NotNull Range other)
richSafeSubSequenceback to summary
public @NotNull RichSequence richSafeSubSequence(@NotNull CharSequence charSequence)
Annotations
@NotNull
richSubSequenceback to summary
public @NotNull RichSequence richSubSequence(@NotNull CharSequence charSequence)
Annotations
@NotNull
safeSubSequenceback to summary
public @NotNull CharSequence safeSubSequence(@NotNull CharSequence charSequence)
Annotations
@NotNull
shiftLeftback to summary
public Range shiftLeft(int delta)
shiftRightback to summary
public Range shiftRight(int delta)
startMinusback to summary
public Range startMinus(int delta)
startPlusback to summary
public Range startPlus(int delta)
subSequenceback to summary
public @NotNull BasedSequence subSequence(@NotNull CharSequence charSequence)

Deprecated

use basedSubSequence(CharSequence) instead

Return a based subsequence of sequence given by this range

Parameters
charSequence:@NotNull CharSequence

char sequence from which to extract the range

Returns:@NotNull BasedSequence

resulting based subsequence

Annotations
@NotNull
@Deprecated
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
trailedByback to summary
public boolean trailedBy(int index)
trailsback to summary
public boolean trails(int index)
withEndback to summary
public Range withEnd(int end)
withRangeback to summary
public Range withRange(int start, int end)
withStartback to summary
public Range withStart(int start)