public static class Position.LineTabMapImpl extends Object
Modifier and Type | Field and Description |
---|---|
protected int[] |
startPosition |
Constructor and Description |
---|
LineTabMapImpl(int max) |
Modifier and Type | Method and Description |
---|---|
protected void |
build(char[] src,
int max) |
int |
getColumnNumber(int pos)
Find the column for a character position.
|
long |
getColumnNumber(long 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.
|
long |
getLineNumber(long 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).
|
long |
getPosition(long line,
long column)
Find the position corresponding to a (line,column).
|
int |
getStartPosition(int line)
Find the start position of a line.
|
long |
getStartPosition(long line)
Find the start position of a line.
|
protected void |
setTabPosition(int offset) |
protected void setTabPosition(int offset)
public int getColumnNumber(int pos)
Position.LineMap
getColumnNumber
in interface Position.LineMap
pos
- character offset of the positionpublic int getPosition(int line, int column)
Position.LineMap
getPosition
in interface Position.LineMap
line
- number of line (first is 1)column
- number of character on line (first is 1)protected void build(char[] src, int max)
public int getStartPosition(int line)
Position.LineMap
getStartPosition
in interface Position.LineMap
line
- number of line (first is 1)public long getStartPosition(long line)
LineMap
getStartPosition
in interface LineMap
line
- line number (beginning at 1)public long getPosition(long line, long column)
LineMap
getPosition
in interface LineMap
line
- line number (beginning at 1)column
- tab-expanded column number (beginning 1)public int getLineNumber(int pos)
Position.LineMap
getLineNumber
in interface Position.LineMap
pos
- character offset of the positionpublic long getLineNumber(long pos)
LineMap
getLineNumber
in interface LineMap
pos
- character offset of the positionpublic long getColumnNumber(long pos)
LineMap
getColumnNumber
in interface LineMap
pos
- character offset of the positionCopyright © 2015. All rights reserved.