Package codeanalysis.text
Class TextSpan
java.lang.Object
codeanalysis.text.TextSpan
The TextSpan class represents a span of text in a source file.
It defines the start position, length, and end position of the span.
- Version:
- 1.0
- Author:
- Siyabend Urun
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTextSpan(int start, int length) Creates a new instance of the TextSpan class with the specified start position and length. -
Method Summary
Modifier and TypeMethodDescriptionstatic TextSpanfromBounds(int start, int end) Creates a new instance of the TextSpan class with the specified start and end positions.intgetEnd()Retrieves the end position of the text span.intRetrieves the length of the text span.intgetStart()Retrieves the start position of the text span.
-
Constructor Details
-
TextSpan
public TextSpan(int start, int length) Creates a new instance of the TextSpan class with the specified start position and length.- Parameters:
start- The start position of the text span.length- The length of the text span.
-
-
Method Details
-
fromBounds
Creates a new instance of the TextSpan class with the specified start and end positions.- Parameters:
start- The start position of the text span.end- The end position of the text span.- Returns:
- The new text span.
-
getStart
public int getStart()Retrieves the start position of the text span.- Returns:
- The start position.
-
getLength
public int getLength()Retrieves the length of the text span.- Returns:
- The length.
-
getEnd
public int getEnd()Retrieves the end position of the text span.- Returns:
- The end position.
-