Class SourceCodeLocation.SourceCodePoint
- All Implemented Interfaces:
Serializable,Comparable<SourceCodeLocation.SourceCodePoint>
- Enclosing class:
- SourceCodeLocation
For convenience we also store the line number of the point (the line that contains the character following the point) and the index in that line. Both of these indices start at 1. The first line of a file is line 1 and the point before its first character has index 1 on line 1.
The exact definition of lines depends on the language conventions and is best left for the parser to handle. If you want to display the text at that location, either use the character index or use the line number and the index in the line together with lines as they were split by the parser.
It might happen that the source code point for something is not known. This is modeled by a point with the special value -1 for the character index. The line and the index on the line must be 0 in this case.
Instances of this class are immutable.
- See Also:
-
Method Summary
-
Method Details
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable<SourceCodeLocation.SourceCodePoint>
-