public interface LineMap
Modifier and Type | Method | Description |
---|---|---|
long |
getColumnNumber |
Finds the column for a character position. |
long |
getLineNumber |
Finds the line containing a position; a line termination character is on the line it terminates. |
long |
getPosition |
Finds the position corresponding to a (line,column). |
long |
getStartPosition |
Finds the start position of a line. |
long getStartPosition(long line)
line
- line number (beginning at 1)IndexOutOfBoundsException
- if lineNumber < 1
if lineNumber > no. of lines
long getPosition(long line, long column)
line
- line number (beginning at 1)column
- tab-expanded column number (beginning 1)IndexOutOfBoundsException
- if line < 1
if line > no. of lines
long getLineNumber(long pos)
pos
- character offset of the positionlong getColumnNumber(long pos)
pos
- character offset of the position
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/jdk.compiler/com/sun/source/tree/LineMap.html