java.lang.Object
com.maroontress.clione.SourceSpan
The representation of the contiguous range of the source file.
Note that the SourceSpan
instance is an immutable object.
-
Constructor Summary
ConstructorDescriptionSourceSpan
(SourceLocation where) Creates a new instance representing the single character.SourceSpan
(SourceLocation start, SourceLocation end) Creates a new instance.SourceSpan
(SourceSpan first, SourceSpan last) Creates a new instance representing the range between the specifiedSourceSpan
s (that includes both of them). -
Method Summary
-
Constructor Details
-
SourceSpan
Creates a new instance.- Parameters:
start
- The start location of the range.end
- The end location of the range.
-
SourceSpan
Creates a new instance representing the single character.- Parameters:
where
- The start and end location of the range.
-
SourceSpan
Creates a new instance representing the range between the specifiedSourceSpan
s (that includes both of them).- Parameters:
first
- The start span.last
- The end span.
-
-
Method Details
-
getStart
Returns the start location of this range.- Returns:
- The start location.
-
getEnd
Returns the end location of this range.- Returns:
- The end location.
-
toString
Returns a new string representation of this range that is easy for a person to read.This method returns a string equal to the value of either:
Ln1:xx--Ln2:xx
Ln1:m1--m2
Ln1:m1
where
n1
,n2
,m1
,m2
, andxx
are positive integers,n1
<n2
,m1
<m2
,n1
andn2
represent the line number, andm1
,m2
, andxx
represent the column number.
-