Class UnderlinedRange
- java.lang.Object
-
- org.sonarsource.analyzer.commons.checks.verifier.internal.UnderlinedRange
-
- All Implemented Interfaces:
Comparable<UnderlinedRange>
public class UnderlinedRange extends Object implements Comparable<UnderlinedRange>
Used to specify the location of an issue in source code.
-
-
Field Summary
Fields Modifier and Type Field Description intcolumnstart at 1, column number of the first character of the tokenintendColumnstart at 1, column number of the last character of the token if the token has only one character, endColumn == columnintendLinestart at 1, line number of the last character of the token if the token is on a single line, endLine == lineintlinestart at 1, line number of the first character of the token
-
Constructor Summary
Constructors Constructor Description UnderlinedRange(int line, int column, int endLine, int endColumn)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(UnderlinedRange other)booleanequals(Object other)inthashCode()StringtoString()voidunderline(int indent, StringBuilder textLine)
-
-
-
Field Detail
-
line
public final int line
start at 1, line number of the first character of the token
-
column
public final int column
start at 1, column number of the first character of the token
-
endLine
public final int endLine
start at 1, line number of the last character of the token if the token is on a single line, endLine == line
-
endColumn
public final int endColumn
start at 1, column number of the last character of the token if the token has only one character, endColumn == column
-
-
Constructor Detail
-
UnderlinedRange
public UnderlinedRange(int line, int column, int endLine, int endColumn)- Parameters:
line- , start at 1, line number of the first character of the token, same as TokenLocation#startLine()column- , start at 1, column number of the first character of the token, same as TokenLocation#startLineOffset()+1,endLine- , start at 1, line number of the last character of the token, same as TokenLocation#endLine(), if the token is on a single line, endLine == lineendColumn- , start at 1, column number of the last character of the token, same as TokenLocation#endLineOffset(), if the token has only one character, endColumn == column
-
-
Method Detail
-
compareTo
public int compareTo(UnderlinedRange other)
- Specified by:
compareToin interfaceComparable<UnderlinedRange>
-
underline
public void underline(int indent, StringBuilder textLine)
-
-