com.sun.tools.javac.util
Interface Position.LineMap

All Superinterfaces:
LineMap
All Known Implementing Classes:
Position.LineMapImpl, Position.LineTabMapImpl
Enclosing class:
Position

public static interface Position.LineMap
extends LineMap


Method Summary
 int getColumnNumber(int pos)
          Find the column for a character position.
 int getLineNumber(int pos)
          Find the line containing a position; a line termination character is on the line it terminates.
 int getPosition(int line, int column)
          Find the position corresponding to a (line,column).
 int getStartPosition(int line)
          Find the start position of a line.
 
Methods inherited from interface com.sun.source.tree.LineMap
getColumnNumber, getLineNumber, getPosition, getStartPosition
 

Method Detail

getStartPosition

int getStartPosition(int line)
Find the start position of a line.

Parameters:
line - number of line (first is 1)
Returns:
position of first character in line
Throws:
java.lang.ArrayIndexOutOfBoundsException - if lineNumber < 1 if lineNumber > no. of lines

getPosition

int getPosition(int line,
                int column)
Find the position corresponding to a (line,column).

Parameters:
line - number of line (first is 1)
column - number of character on line (first is 1)
Returns:
position of character
Throws:
java.lang.ArrayIndexOutOfBoundsException - if line < 1 if line > no. of lines

getLineNumber

int getLineNumber(int pos)
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 on which pos occurs (first line is 1)

getColumnNumber

int getColumnNumber(int pos)
Find the column for a character position. Note: this method does not handle tab expansion. If tab expansion is needed, use a LineTabMap instead.

Parameters:
pos - character offset of the position
Returns:
the column number at which pos occurs