This class internally keeps a cache of the indices of all the line break characters scanned so far, therefore repeated location lookup can be done in amortized log(n) time.
It is not multi-thread safe.
| Modifier and Type | Field and Description |
|---|---|
| private static final char | LINE_BREAK
The line break character. |
| pack-priv final IntList | lineBreakIndices
The 0-based indices of the line break characters scanned so far. |
| pack-priv int | nextColumnIndex
The 0-based index of the column of the next character to be scanned. |
| pack-priv int | nextIndex
The 0-based index of the next character to be scanned. |
| private final CharSequence | |
| private final int | startColumnNumber
The first column number. |
| private final int | startLineNumber
The first line number. |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv | SourceLocator(CharSequence
the source. source, int the starting line number. lineNumber, int the starting column number. columnNumber)Creates a |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static int | binarySearch(IntList ascendingInts, int value)
Uses binary search to look up the index of the first element in |
| private int | getLineBreakColumnIndex(int lineIndex)
Gets the 0-based column number of the line break character for line identified by
|
| private Location | getLineBreakLocation(int lineIndex)
References Deprecated
Location is deprecated or references (maybe indirectly) at least one deprecated element.
|
| pack-priv Location | |
| private Location | |
| pack-priv Location | |
| pack-priv Location |
| LINE_BREAK | back to summary |
|---|---|
| private static final char LINE_BREAK The line break character. | |
| lineBreakIndices | back to summary |
|---|---|
| pack-priv final IntList lineBreakIndices The 0-based indices of the line break characters scanned so far. | |
| nextColumnIndex | back to summary |
|---|---|
| pack-priv int nextColumnIndex The 0-based index of the column of the next character to be scanned. | |
| nextIndex | back to summary |
|---|---|
| pack-priv int nextIndex The 0-based index of the next character to be scanned. | |
| source | back to summary |
|---|---|
| private final CharSequence source | |
| startColumnNumber | back to summary |
|---|---|
| private final int startColumnNumber The first column number. | |
| startLineNumber | back to summary |
|---|---|
| private final int startLineNumber The first line number. | |
| SourceLocator | back to summary |
|---|---|
| pack-priv SourceLocator(CharSequence source) Creates a
| |
| SourceLocator | back to summary |
|---|---|
| pack-priv SourceLocator(CharSequence source, int lineNumber, int columnNumber) Creates a
| |
| binarySearch | back to summary |
|---|---|
| pack-priv static int binarySearch(IntList ascendingInts, int value) Uses binary search to look up the index of the first element in
| |
| getLineBreakColumnIndex | back to summary |
|---|---|
| private int getLineBreakColumnIndex(int lineIndex) Gets the 0-based column number of the line break character for line identified by
| |
| getLineBreakLocation | back to summary |
|---|---|
| private Location getLineBreakLocation(int lineIndex)
References Deprecated
See corresponding docs for further information. | |
| locate | back to summary |
|---|---|
| pack-priv Location locate(int index)
References Deprecated
See corresponding docs for further information. | |
| location | back to summary |
|---|---|
| private Location location(int l, int c)
References Deprecated
See corresponding docs for further information. | |
| lookup | back to summary |
|---|---|
| pack-priv Location lookup(int index)
References Deprecated
See corresponding docs for further information. Looks up the location identified by
| |
| scanTo | back to summary |
|---|---|
| pack-priv Location scanTo(int index)
References Deprecated
See corresponding docs for further information. Scans from After this method returns,
| |