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 |
|---|---|
| pack-priv static class | UnicodeReader.
This is a specialized version of UnicodeReader that keeps track of the column position within a given character stream. |
| private static enum |
| Modifier and Type | Field and Description |
|---|---|
| private final char[] | buffer
Buffer containing characters from source file. |
| private char | character
Character currently being observed. |
| private int | codepoint
Codepoint of character currently being observed. |
| private final int | length
Length of meaningful content in buffer. |
| private final Log | log
Log for error reporting. |
| private final int | offset
Virtual position offset in the original buffer. |
| private int | position
Character buffer index of character currently being observed. |
| private boolean | wasBackslash
true if the last character was a backslash. |
| private boolean | wasUnicodeEscape
true if the last character was derived from an unicode escape sequence. |
| private int | width
Number of characters combined to provide character currently being observed. |
| Access | Constructor and Description |
|---|---|
| protected | UnicodeReader(ScannerFactory
scan factory. sf, char[] array containing contents of source. array, int length of meaningful content in buffer. length)Constructor. |
| protected | UnicodeReader(Log
Log for error reporting. log, char[] array containing contents of source. array, int length of meaningful content in buffer. length)Constructor. |
| protected | UnicodeReader(Log
Log for error reporting. log, char[] array containing contents of source. array, int offset, int start of meaningful content in buffer. pos, int end of meaningful content in buffer. endPos)Constructor. |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | Returns: true if a match.character to match. ch)Compare character and advance if a match. |
| protected boolean | |
| protected boolean | |
| protected boolean | |
| protected char[] | |
| protected int | Returns: value of digit.starting position. pos, int base of number being converted. digitRadix)Convert an ASCII digit from its base (8, 10, or 16) to its value. |
| protected char | Returns: current character in at the current position.Return the current character in at the current position. |
| protected int | Returns: current codepoint in at the current position.Return the current codepoint in at the current position. |
| public char[] | |
| public char[] | getRawCharacters(int
the beginning index, inclusive. beginIndex, int the ending index, exclusive. endIndex)Returns a copy of a character array subset of the input buffer. |
| public String | getRawString(int
the beginning index, inclusive. beginIndex, int the ending index, exclusive. endIndex)Returns a string subset of the input buffer. |
| public String | |
| protected boolean | Returns: true if the current character is in range.lowest character in range. lo, char highest character in range. hi)Tests to see if current character is in the range of lo to hi characters (inclusive). |
| protected boolean | |
| protected boolean | Returns: true if the current character is ASCII.Returns true if the current character is ASCII. |
| protected boolean | Returns: true if current position is within the meaningful part of the buffer.Return true if current position is within the meaningful part of the buffer. |
| protected boolean | |
| protected boolean | |
| protected boolean | |
| protected boolean | |
| protected boolean | |
| protected boolean | Returns: true if the current codepoint is a surrogate.Returns true if the current codepoint is a surrogate. |
| protected boolean | |
| protected int | |
| protected UnicodeReader | Returns: a new readerReturn a reader which is bracketed by the currect position and the next line terminator. |
| protected UnicodeReader | Returns: a new readerinitial position pos, int end position endPos)Return a reader which is bracketed by the |
| protected char | |
| private void | |
| private void | |
| private void | |
| protected int | Returns: virtual position in the character buffer.Return the virtual position in the character buffer. |
| protected void | |
| protected int | Returns: number of characters skippedcharacter to accept. ch)Skip over all occurrences of character. |
| protected void | |
| protected void | |
| private UnicodeReader. |
| buffer | back to summary |
|---|---|
| private final char[] buffer Buffer containing characters from source file. May contain extraneous characters beyond this.length. | |
| character | back to summary |
|---|---|
| private char character Character currently being observed. If a surrogate pair is read then will be the high member of the pair. | |
| codepoint | back to summary |
|---|---|
| private int codepoint Codepoint of character currently being observed. Typically equivalent to the character but will have a value greater that 0xFFFF when a surrogate pair. | |
| length | back to summary |
|---|---|
| private final int length Length of meaningful content in buffer. | |
| log | back to summary |
|---|---|
| private final Log log Log for error reporting. | |
| offset | back to summary |
|---|---|
| private final int offset Virtual position offset in the original buffer. | |
| position | back to summary |
|---|---|
| private int position Character buffer index of character currently being observed. | |
| wasBackslash | back to summary |
|---|---|
| private boolean wasBackslash true if the last character was a backslash. This is used to handle the special case when a backslash precedes an unicode escape. In that case, the second backslash is treated as a backslash and not part of an unicode escape. | |
| wasUnicodeEscape | back to summary |
|---|---|
| private boolean wasUnicodeEscape true if the last character was derived from an unicode escape sequence. | |
| width | back to summary |
|---|---|
| private int width Number of characters combined to provide character currently being observed. Typically one, but may be more when combinations of surrogate pairs and unicode escape sequences are read. | |
| UnicodeReader | back to summary |
|---|---|
| protected UnicodeReader(ScannerFactory sf, char[] array, int length) Constructor.
| |
| UnicodeReader | back to summary |
|---|---|
| protected UnicodeReader(Log log, char[] array, int length) Constructor.
| |
| UnicodeReader | back to summary |
|---|---|
| protected UnicodeReader(Log log, char[] array, int offset, int pos, int endPos) Constructor.
| |
| accept | back to summary |
|---|---|
| protected boolean accept(char ch) Compare character and advance if a match. Returns true if a match.
| |
| accept | back to summary |
|---|---|
| protected boolean accept(String string) Compare string and advance if a match. Returns true if a match. Warning Do not use when previous character was a backslash (confuses state of wasBackslash.)
| |
| acceptOneOf | back to summary |
|---|---|
| protected boolean acceptOneOf(char ch1, char ch2) Match one of the arguments and advance if a match. Returns true if a match. | |
| acceptOneOf | back to summary |
|---|---|
| protected boolean acceptOneOf(char ch1, char ch2, char ch3) Match one of the arguments and advance if a match. Returns true if a match. | |
| buffer | back to summary |
|---|---|
| protected char[] buffer() Returns the character buffer.
| |
| digit | back to summary |
|---|---|
| protected int digit(int pos, int digitRadix) Convert an ASCII digit from its base (8, 10, or 16) to its value. Does not advance character.
| |
| get | back to summary |
|---|---|
| protected char get() Return the current character in at the current position.
| |
| getCodepoint | back to summary |
|---|---|
| protected int getCodepoint() Return the current codepoint in at the current position.
| |
| getRawCharacters | back to summary |
|---|---|
| public char[] getRawCharacters() Returns the input buffer. Unicode escape sequences are not translated.
| |
| getRawCharacters | back to summary |
|---|---|
| public char[] getRawCharacters(int beginIndex, int endIndex) Returns a copy of a character array subset of the input buffer.
The returned array begins at the
| |
| getRawString | back to summary |
|---|---|
| public String getRawString(int beginIndex, int endIndex) Returns a string subset of the input buffer.
The returned string begins at the
| |
| getRawString | back to summary |
|---|---|
| public String getRawString() Returns a string subset of the input buffer.
The returned string begins at the
| |
| inRange | back to summary |
|---|---|
| protected boolean inRange(char lo, char hi) Tests to see if current character is in the range of lo to hi characters (inclusive).
| |
| is | back to summary |
|---|---|
| protected boolean is(char ch) Compare character. Returns true if a match.
| |
| isASCII | back to summary |
|---|---|
| protected boolean isASCII() Returns true if the current character is ASCII.
| |
| isAvailable | back to summary |
|---|---|
| protected boolean isAvailable() Return true if current position is within the meaningful part of the buffer.
| |
| isEOLN | back to summary |
|---|---|
| protected boolean isEOLN() Is ASCII line terminator.
| |
| isOneOf | back to summary |
|---|---|
| protected boolean isOneOf(char ch1, char ch2) Match one of the arguments. Returns true if a match. | |
| isOneOf | back to summary |
|---|---|
| protected boolean isOneOf(char ch1, char ch2, char ch3) | |
| isOneOf | back to summary |
|---|---|
| protected boolean isOneOf(char ch1, char ch2, char ch3, char ch4) | |
| isOneOf | back to summary |
|---|---|
| protected boolean isOneOf(char ch1, char ch2, char ch3, char ch4, char ch5, char ch6) | |
| isSurrogate | back to summary |
|---|---|
| protected boolean isSurrogate() Returns true if the current codepoint is a surrogate.
| |
| isWhitespace | back to summary |
|---|---|
| protected boolean isWhitespace() Is ASCII white space character.
| |
| length | back to summary |
|---|---|
| protected int length() Returns the length of the buffer. This is length of meaningful content in buffer and not the length of the buffer array.
| |
| lineReader | back to summary |
|---|---|
| protected UnicodeReader lineReader() Return a reader which is bracketed by the currect position and the next line terminator.
| |
| lineReader | back to summary |
|---|---|
| protected UnicodeReader lineReader(int pos, int endPos) Return a reader which is bracketed by the
| |
| next | back to summary |
|---|---|
| protected char next() Advances the current character to the next character.
| |
| nextCodePoint | back to summary |
|---|---|
| private void nextCodePoint() Fetches the nextcode point from the buffer. If an unicode escape is recognized then converts unicode escape to a character. If two characters are a surrogate pair then converts to a codepoint. | |
| nextCodeUnit | back to summary |
|---|---|
| private void nextCodeUnit() Fetches the next 16-bit character from the buffer and places it in this.character. | |
| nextUnicodeInputCharacter | back to summary |
|---|---|
| private void nextUnicodeInputCharacter() Fetches the next 16-bit character from the buffer. If an unicode escape is detected then converts the unicode escape to a character. | |
| position | back to summary |
|---|---|
| protected int position() Return the virtual position in the character buffer.
| |
| reset | back to summary |
|---|---|
| protected void reset(int pos) Reset the reader to the specified virtual position. Warning Do not use when previous character was an ASCII or unicode backslash. | |
| skip | back to summary |
|---|---|
| protected int skip(char ch) Skip over all occurrences of character.
| |
| skipToEOLN | back to summary |
|---|---|
| protected void skipToEOLN() Skip to end of line. | |
| skipWhitespace | back to summary |
|---|---|
| protected void skipWhitespace() Skip over ASCII white space characters. | |
| unicodeEscape | back to summary |
|---|---|
| private UnicodeReader. Converts an unicode escape into a character.
| |
| Modifier and Type | Field and Description |
|---|---|
| private int | column
Current column in the comment. |
| Access | Constructor and Description |
|---|---|
| protected | PositionTrackingReader(UnicodeReader
existing reader reader, int start of meaningful content in buffer. pos, int end of meaningful content in buffer. endPos)Constructor. |
| Modifier and Type | Method and Description |
|---|---|
| protected int | |
| protected char | Returns: next character.Overrides com. Advances the current character to the next character. |
| column | back to summary |
|---|---|
| private int column Current column in the comment. | |
| PositionTrackingReader | back to summary |
|---|---|
| protected PositionTrackingReader(UnicodeReader reader, int pos, int endPos) Constructor.
| |
| column | back to summary |
|---|---|
| protected int column() Returns the current column.
| |
| next | back to summary |
|---|---|
| protected char next() Overrides com. Advances the current character to the next character. Tracks column.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final UnicodeReader. | |
| public static final UnicodeReader. | |
| public static final UnicodeReader. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static UnicodeReader. | |
| public static UnicodeReader. |
| BACKSLASH | back to summary |
|---|---|
| public static final UnicodeReader. | |
| BROKEN_ESCAPE | back to summary |
|---|---|
| public static final UnicodeReader. | |
| VALID_ESCAPE | back to summary |
|---|---|
| public static final UnicodeReader. | |
| UnicodeEscapeResult | back to summary |
|---|---|
| private UnicodeEscapeResult() | |
| valueOf | back to summary |
|---|---|
| public static UnicodeReader. | |
| values | back to summary |
|---|---|
| public static UnicodeReader. | |