Interface LineMap
public interface LineMap
Provides methods to convert between character positions and line numbers
for a compilation unit.
- Since:
- 1.6
- 
Method SummaryModifier and TypeMethodDescriptionlonggetColumnNumber(long pos) Finds the column for a character position.longgetLineNumber(long pos) Finds the line containing a position; a line termination character is on the line it terminates.longgetPosition(long line, long column) Finds the position corresponding to a (line,column).longgetStartPosition(long line) Finds the start position of a line.
- 
Method Details- 
getStartPositionlong getStartPosition(long line) Finds the start position of a line.- Parameters:
- line- line number (beginning at 1)
- Returns:
- position of first character in line
- Throws:
- IndexOutOfBoundsException- if- lineNumber < 1if- lineNumber > no. of lines
 
- 
getPositionlong getPosition(long line, long column) Finds the position corresponding to a (line,column).- Parameters:
- line- line number (beginning at 1)
- column- tab-expanded column number (beginning 1)
- Returns:
- position of character
- Throws:
- IndexOutOfBoundsException- if- line < 1if- line > no. of lines
 
- 
getLineNumberlong getLineNumber(long pos) Finds the line containing a position; a line termination character is on the line it terminates.- Parameters:
- pos- character offset of the position
- Returns:
- the line number of pos (first line is 1)
 
- 
getColumnNumberlong getColumnNumber(long pos) Finds the column for a character position. Tab characters preceding the position on the same line will be expanded when calculating the column number.- Parameters:
- pos- character offset of the position
- Returns:
- the tab-expanded column number of pos (first column is 1)
 
 
-