This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | |
| pack-priv static class | |
| public static class | Position.
A LineMap that handles tab expansion correctly. |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static int | Returns: an encoded position orPosition#NOPOS
if the line or column number is too big to
represent in the encoded formatnumber of line (first is 1) line, int number of character on line (first is 1) col)Encode line and column numbers in an integer as:
|
| public static Position. | makeLineMap(char[]
Source characters src, int Number of characters to read max, boolean If true, expand tabs when calculating columns expandTabs)A two-way map between line/column numbers and positions, derived from a scan done at creation time. |
| FIRSTCOLUMN | back to summary |
|---|---|
| public static final int FIRSTCOLUMN | |
| FIRSTLINE | back to summary |
|---|---|
| public static final int FIRSTLINE | |
| FIRSTPOS | back to summary |
|---|---|
| public static final int FIRSTPOS | |
| LINESHIFT | back to summary |
|---|---|
| public static final int LINESHIFT | |
| MAXCOLUMN | back to summary |
|---|---|
| public static final int MAXCOLUMN | |
| MAXLINE | back to summary |
|---|---|
| public static final int MAXLINE | |
| MAXPOS | back to summary |
|---|---|
| public static final int MAXPOS | |
| NOPOS | back to summary |
|---|---|
| public static final int NOPOS | |
| Position | back to summary |
|---|---|
| private Position() This is class is not supposed to be instantiated. | |
| encodePosition | back to summary |
|---|---|
| public static int encodePosition(int line, int col) Encode line and column numbers in an integer as:
| |
| makeLineMap | back to summary |
|---|---|
| public static Position. A two-way map between line/column numbers and positions, derived from a scan done at creation time. Tab expansion is optionally supported via a character map. Text content is not retained. Notes The first character position FIRSTPOS is at (FIRSTLINE,FIRSTCOLUMN). No account is taken of Unicode escapes.
| |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: the column number at which pos occurscharacter offset of the position pos)Find the column for a character position. |
| public int | Returns: the line number on which pos occurs (first line is 1)character offset of the position pos)Find the line containing a position; a line termination character is on the line it terminates. |
| public int | Returns: position of characternumber of line (first is 1) line, int number of character on line (first is 1) column)Find the position corresponding to a (line,column). |
| public int | Returns: position of first character in linenumber of line (first is 1) line)Find the start position of a line. |
| getColumnNumber | back to summary |
|---|---|
| public 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.
| |
| getLineNumber | back to summary |
|---|---|
| public int getLineNumber(int pos) Find the line containing a position; a line termination character is on the line it terminates.
| |
| getPosition | back to summary |
|---|---|
| public int getPosition(int line, int column) Find the position corresponding to a (line,column).
| |
| getStartPosition | back to summary |
|---|---|
| public int getStartPosition(int line) Find the start position of a line.
| |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private int | |
| protected int[] |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| public int | getColumnNumber(int pos)
Implements com. Find the column for a character position. |
| public long | getColumnNumber(long pos)
Implements com. Finds the column for a character position. |
| public int | getLineNumber(int pos)
Implements com. Find the line containing a position; a line termination character is on the line it terminates. |
| public long | getLineNumber(long pos)
Implements com. Finds the line containing a position; a line termination character is on the line it terminates. |
| public int | getPosition(int line, int column)
Implements com. Find the position corresponding to a (line,column). |
| public long | getPosition(long line, long column)
Implements com. Finds the position corresponding to a (line,column). |
| public int | getStartPosition(int line)
Implements com. Find the start position of a line. |
| public long | getStartPosition(long line)
Implements com. Finds the start position of a line. |
| private static int | |
| protected void |
| lastLine | back to summary |
|---|---|
| private int lastLine | |
| lastPosition | back to summary |
|---|---|
| private int lastPosition | |
| startPosition | back to summary |
|---|---|
| protected int[] startPosition | |
| LineMapImpl | back to summary |
|---|---|
| protected LineMapImpl() | |
| build | back to summary |
|---|---|
| protected void build(char[] src, int max) | |
| getColumnNumber | back to summary |
|---|---|
| public int getColumnNumber(int pos) Implements com. Doc from com. Find the column for a character position. Note this method does not handle tab expansion. If tab expansion is needed, use a LineTabMap instead. | |
| getColumnNumber | back to summary |
|---|---|
| public long getColumnNumber(long pos) Implements com. Doc from com. Finds the column for a character position. Tab characters preceding the position on the same line will be expanded when calculating the column number.
| |
| getLineNumber | back to summary |
|---|---|
| public int getLineNumber(int pos) Implements com. Doc from com. Find the line containing a position; a line termination character is on the line it terminates. | |
| getLineNumber | back to summary |
|---|---|
| public long getLineNumber(long pos) Implements com. Doc from com. Finds the line containing a position; a line termination character is on the line it terminates.
| |
| getPosition | back to summary |
|---|---|
| public int getPosition(int line, int column) Implements com. Doc from com. Find the position corresponding to a (line,column). | |
| getPosition | back to summary |
|---|---|
| public long getPosition(long line, long column) Implements com. Doc from com. Finds the position corresponding to a (line,column).
| |
| getStartPosition | back to summary |
|---|---|
| public int getStartPosition(int line) Implements com. Doc from com. Find the start position of a line. | |
| getStartPosition | back to summary |
|---|---|
| public long getStartPosition(long line) Implements com. Doc from com. Finds the start position of a line.
| |
| longToInt | back to summary |
|---|---|
| private static int longToInt(long longValue) | |
| setTabPosition | back to summary |
|---|---|
| protected void setTabPosition(int offset) | |
| Modifier and Type | Field and Description |
|---|---|
| private BitSet |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | getColumnNumber(int pos)
Overrides com. Implements com. Find the column for a character position. |
| public int | getPosition(int line, int column)
Overrides com. Implements com. Find the position corresponding to a (line,column). |
| protected void |
| tabMap | back to summary |
|---|---|
| private BitSet tabMap | |
| LineTabMapImpl | back to summary |
|---|---|
| public LineTabMapImpl(int max) | |
| getColumnNumber | back to summary |
|---|---|
| public int getColumnNumber(int pos) Overrides com. Implements com. Doc from com. Find the column for a character position. Note this method does not handle tab expansion. If tab expansion is needed, use a LineTabMap instead. | |
| getPosition | back to summary |
|---|---|
| public int getPosition(int line, int column) Overrides com. Implements com. Doc from com. Find the position corresponding to a (line,column). | |
| setTabPosition | back to summary |
|---|---|
| protected void setTabPosition(int offset) Overrides com. | |