Class TextSpan

java.lang.Object
codeanalysis.text.TextSpan

public class TextSpan extends Object
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

    Constructors
    Constructor
    Description
    TextSpan(int start, int length)
    Creates a new instance of the TextSpan class with the specified start position and length.
  • Method Summary

    Modifier and Type
    Method
    Description
    static TextSpan
    fromBounds(int start, int end)
    Creates a new instance of the TextSpan class with the specified start and end positions.
    int
    Retrieves the end position of the text span.
    int
    Retrieves the length of the text span.
    int
    Retrieves the start position of the text span.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public static TextSpan fromBounds(int start, int end)
      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.