Package source
Class SourceSpan
- java.lang.Object
-
- source.SourceSpan
-
public final class SourceSpan extends java.lang.ObjectThe SourceSpan class is used to store information about the location of Expression and Statement objects relative to the source code.It holds information about the start index, end index, and total length of each line.
- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description SourceSpan(int start, int length)Constructs a SourceSpan object for storing information about each Expression or Statements location.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SourceSpaninRange(int start, int end)Creates and returns a SourceSpan object for storing information about each Expression or Statements location.
-
-
-
Constructor Detail
-
SourceSpan
public SourceSpan(int start, int length)Constructs a SourceSpan object for storing information about each Expression or Statements location.The end index is automatically calculated by adding the start and length together.
- Parameters:
start- The start index of the span, relative to the source codelength- The length of the span
-
-
Method Detail
-
inRange
public static SourceSpan inRange(int start, int end)
Creates and returns a SourceSpan object for storing information about each Expression or Statements location.This method differs from the SourceSpan constructor as it allows for the creation of an instance where the end index can be manually defined.
- Parameters:
start- The start index of the span, relative to the source codeend- The end index of the span, relative to the source code- Returns:
- A SourceSpan object
-
-