Interface LineMap

@Deprecated(since="11",
            forRemoval=true)
public interface LineMap
Deprecated, for removal: This API element is subject to removal in a future version.
Nashorn JavaScript script engine and APIs, and the jjs tool are deprecated with the intent to remove them in a future release.

Provides methods to convert between character positions and line numbers for a compilation unit.

Since:
9

Methods

Modifier and Type Method Description
long getColumnNumber​(long pos)

Deprecated, for removal: This API element is subject to removal in a future version.

Find the column for a character position.

long getLineNumber​(long pos)

Deprecated, for removal: This API element is subject to removal in a future version.

Find the line containing a position; a line termination character is on the line it terminates.

Methods

getLineNumber

long getLineNumber(long pos)
Deprecated, for removal: This API element is subject to removal in a future version.

Find 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)

getColumnNumber

long getColumnNumber(long pos)
Deprecated, for removal: This API element is subject to removal in a future version.

Find 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)

© 1993, 2020, 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/11/docs/api/jdk.scripting.nashorn/jdk/nashorn/api/tree/LineMap.html