Class TextPos2d
java.lang.Object
net.sourceforge.pmd.lang.document.TextPos2d
- All Implemented Interfaces:
Comparable<TextPos2d>
A place in a text document, represented as line/column information.
Line and column are 1-based.
-
Method Summary
Modifier and TypeMethodDescriptionintCompares the start offset, then the length of a region.booleanintReturns the (1-based) column number.intgetLine()Returns the (1-based) line number.inthashCode()static TextPos2dpos2d(int line, int column) Builds a new region from offset and length.Returns a string looking like"line 2, column 4").Returns a string looking like"2:4").toString()Returns a string looking like"(line=2, column=4)".
-
Method Details
-
getLine
public int getLine()Returns the (1-based) line number. -
getColumn
public int getColumn()Returns the (1-based) column number. -
pos2d
Builds a new region from offset and length.- Throws:
AssertionError- If either parameter is negative
-
compareTo
Compares the start offset, then the length of a region.- Specified by:
compareToin interfaceComparable<TextPos2d>
-
toTupleString
Returns a string looking like"(line=2, column=4)". -
toDisplayStringInEnglish
Returns a string looking like"line 2, column 4"). -
toDisplayStringWithColon
Returns a string looking like"2:4"). -
toString
-
equals
-
hashCode
public int hashCode()
-