- All Known Implementing Classes:
AbstractCharStreamScanner,CharReaderScanner,CharSequenceScanner
public interface CharStreamScanner
This is the interface for a scanner that can be used to parse a stream or sequence of characters.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final charThe NULL character'\0'used to indicate the end of stream (EOS).
ATTENTION: Do not confuse and mix'\0'with'0'. -
Method Summary
Modifier and TypeMethodDescriptionConsumes the characters of a decimal number (double or float).booleanexpectOne(char expected) This method checks that thenext characteris equal to the givenexpectedcharacter.default booleanexpectOne(CharFilter expected) default booleanexpectStrict(String expected) This method acts asexpectUnsafe(String, boolean)but if the expected String is NOT completely present, no character isconsumedand the state of the scanner remains unchanged.
Attention:
This method requires lookahead.default booleanexpectStrict(String expected, boolean ignoreCase) This method acts asexpectUnsafe(String, boolean)but if the expected String is NOT completely present, no character isconsumedand the state of the scanner remains unchanged.
Attention:
This method requires lookahead.booleanexpectStrict(String expected, boolean ignoreCase, boolean lookahead) This method acts asexpectUnsafe(String, boolean)but if the expected String is NOT completely present, no character isconsumedand the state of the scanner remains unchanged.
Attention:
This method requires lookahead.default booleanexpectUnsafe(String expected) This method skips allnext charactersas long as they equal to the according character of theexpectedstring.booleanexpectUnsafe(String expected, boolean ignoreCase) This method skips allnext charactersas long as they equal to the according character of theexpectedstring.intbooleanhasNext()This method determines if there is at least one more character available.charnext()This method reads the current character from the stream and increments the index stepping to the next character.charpeek()This method reads the current character without incrementing the index.read(int count) This method reads the number ofnext charactersgiven bycountand returns them as string.default intThis method reads thenext characterif it is a digit.intreadDigit(int radix) This method reads thenext characterif it is a digit within the givenradix.default doubleThis method reads the double value (decimal number) starting at the current position by reading as many matching characters as available and returns itsparsedvalue.default floatThis method reads the float value (decimal number) starting at the current position by reading as many matching characters as available and returns itsparsedvalue.default CharacterReads and parses a JavaCharacterliteral value according to JLS 3.10.6.readJavaCharLiteral(boolean tolerant) Reads and parses a JavaCharacterliteral value according to JLS 3.10.6.default StringReads and parses a JavaStringliteral value according to JLS 3.10.6.readJavaStringLiteral(boolean tolerant) Reads and parses a JavaStringliteral value according to JLS 3.10.6.default StringreadLine()readLine(boolean trim) longreadLong(int maxDigits) This method reads the long starting at the current position by reading as many Latin digits as available but at maximum the givenmaxDigitsand returns itsparsedvalue.readUntil(char stop, boolean acceptEnd) This method reads allnext charactersuntil the givenstopcharacter or the end is reached.readUntil(char stop, boolean acceptEnd, char escape) This method reads allnext charactersuntil the given (un-escaped)stopcharacter or the end is reached.readUntil(char stop, boolean acceptEnd, CharScannerSyntax syntax) This method reads allnext charactersuntil the givenstopcharacter or the end of the string to parse is reached.readUntil(CharFilter filter, boolean acceptEnd) This method reads allnext charactersuntil the first characteracceptedby the givenfilteror the end is reached.readUntil(CharFilter filter, boolean acceptEnd, CharScannerSyntax syntax) This method reads allnext charactersuntil the givenCharFilteracceptsthe current character as stop character or the end of data is reached.default StringreadUntil(CharFilter filter, boolean acceptEnd, String stop) This method reads allnext charactersuntil the first characteracceptedby the givenfilter, the givenstopStringor the end is reached.default StringreadUntil(CharFilter filter, boolean acceptEnd, String stop, boolean ignoreCase) This method reads allnext charactersuntil the first characteracceptedby the givenfilter, the givenstopStringor the end is reached.readUntil(CharFilter filter, boolean acceptEnd, String stop, boolean ignoreCase, boolean trim) This method reads allnext charactersuntil the first characteracceptedby the givenfilter, the givenstopStringor the end is reached.default StringreadWhile(CharFilter filter) readWhile(CharFilter filter, int max) default intrequire(CharFilter filter, int min) default intrequire(CharFilter filter, int min, int max) voidThis method verifies that theexpectedstring gets consumed from this scanner with respect toignoreCase.default voidrequireOne(char expected) This method verifies that thenext characteris equal to the givenexpectedcharacter.default intrequireOne(CharFilter filter) default intrequireOneOrMore(CharFilter filter) intskip(int count) This method skips the number ofnext charactersgiven bycount.default booleanThis method reads allnext charactersuntil the givensubstringhas been detected.default booleanThis method reads allnext charactersuntil the givensubstringhas been detected.booleanskipOver(String substring, boolean ignoreCase, CharFilter stopFilter) This method consumes allnext charactersuntil the givensubstringhas been detected, a character wasacceptedby the givenCharFilteror the end of data was reached.
After the call of this method this scanner will point to the next character after the first occurrence ofsubstring, to the stop character or to end of data.booleanskipUntil(char stop) This method skips allnext charactersuntil the givenstopcharacter or the end is reached.booleanskipUntil(char stop, char escape) This method reads allnext charactersuntil the givenstopcharacter or the end of the string to parse is reached.intskipWhile(char c) This method reads allnext charactersthat are identical to the character given byc.default intskipWhile(CharFilter filter) intskipWhile(CharFilter filter, int max) default charskipWhileAndPeek(CharFilter filter) Behaves like the following code:default charskipWhileAndPeek(CharFilter filter, int max) Behaves like the following code:
-
Field Details
-
EOS
static final char EOSThe NULL character'\0'used to indicate the end of stream (EOS).
ATTENTION: Do not confuse and mix'\0'with'0'.- See Also:
-
-
Method Details
-
hasNext
boolean hasNext()This method determines if there is at least one more character available.- Returns:
trueif there is at least one character available,falseif the end of data has been reached.
-
next
char next()This method reads the current character from the stream and increments the index stepping to the next character. You shouldcheckif a character is available before calling this method. Otherwise if your stream may contain the NUL character ('\0') you can not distinguish if the end of the stream was reached or you actually read the NUL character. -
peek
char peek()This method reads the current character without incrementing the index. -
getPosition
int getPosition()- Returns:
- the position in the sequence to scan or in other words the number of bytes that have been read. Will
initially be
0. Please note that this API is designed for scanning textual content (for parsers). Therefore we consider 2.1 terabyte as a suitablelimit.
-
readDigit
default int readDigit()This method reads thenext characterif it is a digit. Else the state remains unchanged.- Returns:
- the numeric value of the next Latin digit (e.g.
0if'0') or-1if thenext characteris no Latin digit.
-
readDigit
int readDigit(int radix) This method reads thenext characterif it is a digit within the givenradix. Else the state remains unchanged.- Parameters:
radix- the radix that defines the range of the digits. SeeInteger.parseInt(String, int). E.g.10to read any Latin digit (seereadDigit()),8to read octal digit,16to read hex decimal digits.- Returns:
- the numeric value of the next digit within the given
radixor-1if thenext characteris no such digit.
-
readLong
This method reads the long starting at the current position by reading as many Latin digits as available but at maximum the givenmaxDigitsand returns itsparsedvalue.
ATTENTION:
This method does NOT treat signs (+or-) to do so, scan them yourself before and negate the result as needed.- Parameters:
maxDigits- is the maximum number of digits that will be read. The value has to be positive (greater than zero). Use19or higher to be able to read any long number.- Returns:
- the parsed number.
- Throws:
NumberFormatException- if the current current position does NOT point to a number.
-
readDouble
This method reads the double value (decimal number) starting at the current position by reading as many matching characters as available and returns itsparsedvalue.- Returns:
- the parsed number.
- Throws:
NumberFormatException- if the current current position does NOT point to a number.
-
readFloat
This method reads the float value (decimal number) starting at the current position by reading as many matching characters as available and returns itsparsedvalue.- Returns:
- the parsed number.
- Throws:
NumberFormatException- if the current current position does NOT point to a number.
-
consumeDecimal
String consumeDecimal()Consumes the characters of a decimal number (double or float).- Returns:
- the decimal number as
String.
-
read
This method reads the number ofnext charactersgiven bycountand returns them as string. If there are less charactersavailablethe returned string will be shorter thancountand only contain the available characters.- Parameters:
count- is the number of characters to read. You may useInteger.MAX_VALUEto read until the end of data if the data-size is suitable.- Returns:
- a string with the given number of characters or all available characters if less than
count. Will be the empty string if no character isavailableat all.
-
expectUnsafe
This method skips allnext charactersas long as they equal to the according character of theexpectedstring.
If a character differs this method stops and the parser points to the first character that differs fromexpected. Except for the latter circumstance, this method behaves like the following code:
ATTENTION:read(expected.length).equals(expected)
Be aware that if already the first character differs, this method will NOT change the state of the scanner. So take care NOT to produce infinity loops.- Parameters:
expected- is the expected string.- Returns:
trueif theexpectedstring was successfully consumed from this scanner,falseotherwise.
-
expectUnsafe
This method skips allnext charactersas long as they equal to the according character of theexpectedstring.
If a character differs this method stops and the parser points to the first character that differs fromexpected. Except for the latter circumstance, this method behaves like the following code:
ATTENTION:read(expected.length).equals[IgnoreCase](expected)
Be aware that if already the first character differs, this method will NOT change the state of the scanner. So take care NOT to produce infinity loops.- Parameters:
expected- is the expected string.ignoreCase- - iftruethe case of the characters is ignored when compared.- Returns:
trueif theexpectedstring was successfully consumed from this scanner,falseotherwise.
-
expectStrict
This method acts asexpectUnsafe(String, boolean)but if the expected String is NOT completely present, no character isconsumedand the state of the scanner remains unchanged.
Attention:
This method requires lookahead. For implementations that are backed by an underlying stream (or reader) thelengthof the expectedStringshall not exceed the available lookahead size (buffer capacity given at construction time). Otherwise the method may fail.- Parameters:
expected- is the expected string.- Returns:
trueif theexpectedstring was successfully consumed from this scanner,falseotherwise.
-
expectStrict
This method acts asexpectUnsafe(String, boolean)but if the expected String is NOT completely present, no character isconsumedand the state of the scanner remains unchanged.
Attention:
This method requires lookahead. For implementations that are backed by an underlying stream (or reader) thelengthof the expectedStringshall not exceed the available lookahead size (buffer capacity given at construction time). Otherwise the method may fail.- Parameters:
expected- is the expected string.ignoreCase- - iftruethe case of the characters is ignored when compared.- Returns:
trueif theexpectedstring was successfully consumed from this scanner,falseotherwise.
-
expectStrict
This method acts asexpectUnsafe(String, boolean)but if the expected String is NOT completely present, no character isconsumedand the state of the scanner remains unchanged.
Attention:
This method requires lookahead. For implementations that are backed by an underlying stream (or reader) thelengthof the expectedStringshall not exceed the available lookahead size (buffer capacity given at construction time). Otherwise the method may fail.- Parameters:
expected- is the expected string.ignoreCase- - iftruethe case of the characters is ignored when compared.lookahead- - iftruethe state of the scanner remains unchanged even if the expectedStringhas been found,falseotherwise.- Returns:
trueif theexpectedstring was successfully consumed from this scanner,falseotherwise.
-
expectOne
boolean expectOne(char expected) This method checks that thenext characteris equal to the givenexpectedcharacter.
If the current character was as expected, the parser points to the next character. Otherwise its position will remain unchanged.- Parameters:
expected- is the expected character.- Returns:
trueif the current character is the same asexpected,falseotherwise.
-
expectOne
This method checks that thenext characterisacceptedby the givenCharFilter.
If the current character was as expected, the parser points to the next character. Otherwise its position will remain unchanged.- Parameters:
expected- is theCharFilteracceptingthe expected chars.- Returns:
trueif the current character isaccepted,falseotherwise.
-
requireOne
default void requireOne(char expected) This method verifies that thenext characteris equal to the givenexpectedcharacter.
If the current character was as expected, the parser points to the next character. Otherwise an exception is thrown indicating the problem.- Parameters:
expected- is the expected character.
-
require
This method verifies that theexpectedstring gets consumed from this scanner with respect toignoreCase. Otherwise an exception is thrown indicating the problem.
This method behaves functionally equivalent to the following code:if (!scanner.
expectUnsafe(expected, ignoreCase)) { throw newIllegalStateException(...); }- Parameters:
expected- is the expected string.ignoreCase- - iftruethe case of the characters is ignored during comparison.
-
requireOne
- Parameters:
filter- theCharFilteracceptingthe expected characters toskip.- Returns:
- the actual number of characters that have been skipped.
- Throws:
IllegalStateException- if less than1or more than1000acceptedcharacters have been consumed.
-
requireOneOrMore
- Parameters:
filter- theCharFilteracceptingthe expected characters toskip.- Returns:
- the actual number of characters that have been skipped.
- Throws:
IllegalStateException- if less than1or more than1000acceptedcharacters have been consumed.
-
require
- Parameters:
filter- theCharFilteracceptingthe expected characters toskip.min- the minimum required number of skipped characters.- Returns:
- the actual number of characters that have been skipped.
- Throws:
IllegalStateException- if less thanminor more than1000acceptedcharacters have been consumed.
-
require
- Parameters:
filter- theCharFilteracceptingthe expected characters toskip.min- the minimum required number of skipped characters.max- the maximum number of skipped characters.- Returns:
- the actual number of characters that have been skipped.
- Throws:
IllegalStateException- if less thanminor more thanmaxacceptedcharacters have been consumed.
-
skipUntil
boolean skipUntil(char stop) This method skips allnext charactersuntil the givenstopcharacter or the end is reached. If thestopcharacter was reached, this scanner will point to the next character afterstopwhen this method returns.- Parameters:
stop- is the character to read until.- Returns:
trueif the first occurrence of the givenstopcharacter has been passed,falseif there is no such character.
-
skipUntil
boolean skipUntil(char stop, char escape) This method reads allnext charactersuntil the givenstopcharacter or the end of the string to parse is reached. In advance toskipUntil(char), this method will read over thestopcharacter if it is escaped with the givenescapecharacter.- Parameters:
stop- is the character to read until.escape- is the character used to escape the stop character (e.g. '\').- Returns:
trueif the first occurrence of the givenstopcharacter has been passed,falseif there is no such character.
-
readUntil
This method reads allnext charactersuntil the givenstopcharacter or the end is reached.
After the call of this method, the current index will point to the next character after the (first)stopcharacter or to the end if NO such character exists.- Parameters:
stop- is the character to read until.acceptEnd- iftruethe end of data will be treated asstop, too.- Returns:
- the string with all read characters excluding the
stopcharacter ornullif there was nostopcharacter andacceptEndisfalse.
-
readUntil
This method reads allnext charactersuntil the first characteracceptedby the givenfilteror the end is reached.
After the call of this method, the current index will point to the firstacceptedstop character or to the end if NO such character exists.- Parameters:
filter- is used todecidewhere to stop.acceptEnd- iftrueif end of data should be treated like thestopcharacter and the rest of the text will be returned,falseotherwise (to returnnullif the end of data was reached and the scanner has been consumed).- Returns:
- the string with all read characters not
acceptedby the givenCharFilterornullif there was noacceptedcharacter andacceptEndisfalse.
-
readUntil
This method reads allnext charactersuntil the first characteracceptedby the givenfilter, the givenstopStringor the end is reached.
After the call of this method, the current index will point to the firstacceptedstop character, or to the first character of the givenstopStringor to the end if NO such character exists.- Parameters:
filter- is used todecidewhere to stop.acceptEnd- iftrueif the end of data should be treated like thestopcharacter and the rest of the text will be returned,falseotherwise (to returnnullif end of data was reached and the scanner has been consumed).stop- theStringwhere to stop consuming data. Should be at least two characters long (otherwise accept byCharFilterinstead).- Returns:
- the string with all read characters not
acceptedby the givenCharFilteror until the givenstopStringwas detected. If end of data was reached without a stop signal the entire rest of the data is returned ornullifacceptEndisfalse.
-
readUntil
This method reads allnext charactersuntil the first characteracceptedby the givenfilter, the givenstopStringor the end is reached.
After the call of this method, the current index will point to the firstacceptedstop character, or to the first character of the givenstopStringor to the end if NO such character exists.- Parameters:
filter- is used todecidewhere to stop.acceptEnd- iftrueif the end of data should be treated like thestopcharacter and the rest of the text will be returned,falseotherwise (to returnnullif the end of data was reached and the scanner has been consumed).stop- theStringwhere to stop consuming data. Should be at least two characters long (otherwise accept byCharFilterinstead).ignoreCase- - iftruethe case of the characters is ignored when compared with characters fromstopString.- Returns:
- the string with all read characters not
acceptedby the givenCharFilteror until the givenstopStringwas detected. If the end of data was reached without a stop signal the entire rest of the data is returned ornullifacceptEndisfalse.
-
readUntil
String readUntil(CharFilter filter, boolean acceptEnd, String stop, boolean ignoreCase, boolean trim) This method reads allnext charactersuntil the first characteracceptedby the givenfilter, the givenstopStringor the end is reached.
After the call of this method, the current index will point to the firstacceptedstop character, or to the first character of the givenstopStringor to the end if NO such character exists.- Parameters:
filter- is used todecidewhere to stop.acceptEnd- iftrueif the end of data should be treated like thestopcharacter and the rest of the text will be returned,falseotherwise (to returnnullif the end of data was reached and the scanner has been consumed).stop- theStringwhere to stop consuming data. Should be at least two characters long (otherwise accept byCharFilterinstead).ignoreCase- - iftruethe case of the characters is ignored when compared with characters fromstopString.trim- -trueif the result should betrimmed,falseotherwise.- Returns:
- the string with all read characters not
acceptedby the givenCharFilteror until the givenstopStringwas detected. If the end of data was reached without hittingstopthe entire rest of the data is returned ornullifacceptEndisfalse. Thre result will betrimmediftrimistrue.
-
readUntil
This method reads allnext charactersuntil the given (un-escaped)stopcharacter or the end is reached.
In advance toreadUntil(char, boolean), this method allows that thestopcharacter may be used in the input-string by adding the givenescapecharacter. After the call of this method, the current index will point to the next character after the (first)stopcharacter or to the end if NO such character exists.
This method is especially useful when quoted strings should be parsed. E.g.:CharStreamScannerscanner = getScanner(); doSomething(); char c = scanner.next(); if ((c == '"') || (c == '\'')) { char escape = c; // may also be something like '\' String quote = scanner.readUntil(c, false, escape) } else { doOtherThings(); }- Parameters:
stop- is the character to read until.acceptEnd- iftruethe end of data will be treated asstop, too.escape- is the character used to escape thestopcharacter. To add an occurrence of theescapecharacter it has to be duplicated (occur twice). Theescapecharacter may also be equal to thestopcharacter. If other regular characters are escaped theescapecharacter is simply ignored.- Returns:
- the string with all read characters excluding the
stopcharacter ornullif there was nostopcharacter andacceptEndisfalse.
-
readUntil
This method reads allnext charactersuntil the givenstopcharacter or the end of the string to parse is reached. In advance toreadUntil(char, boolean), this method will scan the input using the givensyntaxwhich e.g. allows toescapethe stop character.
After the call of this method, the current index will point to the next character after the (first)stopcharacter or to the end of the string if NO such character exists.- Parameters:
stop- is the character to read until.acceptEnd- iftruethe end of data will be treated asstop, too.syntax- contains the characters specific for the syntax to read.- Returns:
- the string with all read characters excluding the
stopcharacter ornullif there was nostopcharacter. - See Also:
-
readUntil
This method reads allnext charactersuntil the givenCharFilteracceptsthe current character as stop character or the end of data is reached. In advance toreadUntil(char, boolean), this method will scan the input using the givensyntaxwhich e.g. allows toescapethe stop character.
After the call of this method, the current index will point to the next character after the (first)stopcharacter or to the end of the string if NO such character exists.- Parameters:
filter- is used todecidewhere to stop.acceptEnd- iftruethe end of data will be treated asstop, too.syntax- contains the characters specific for the syntax to read.- Returns:
- the string with all read characters excluding the
stopcharacter ornullif there was nostopcharacter. - See Also:
-
readWhile
This method reads allnext charactersthat areacceptedby the givenfilter.
After the call of this method, the current index will point to the next character that was NOTacceptedby the givenfilteror to the end if NO such character exists. -
readWhile
This method reads allnext charactersthat areacceptedby the givenfilter.
After the call of this method, the current index will point to the next character that was NOTacceptedby the givenfilter. If the nextmaxcharacters or the characters left until theendof this scanner areaccepted, only that amount of characters are skipped.- Parameters:
filter- is used todecidewhich characters should be accepted.max- is the maximum number of characters that should be read.- Returns:
- a string with all characters
acceptedby the givenfilterlimited to the length ofmaxand theendof this scanner. Will be the empty string if no character was accepted. - See Also:
-
skip
int skip(int count) This method skips the number ofnext charactersgiven bycount.- Parameters:
count- is the number of characters to skip. You may useInteger.MAX_VALUEto read until the end of data if the data-size is suitable.- Returns:
- a to total number of characters that have been skipped. Typically equal to
count. Will be less in case the end of data was reached.
-
skipOver
This method reads allnext charactersuntil the givensubstringhas been detected.
After the call of this method, the current index will point to the next character after the first occurrence ofsubstringor to the end of data if the givensubstringwas NOT found.- Parameters:
substring- is the substring to search and skip over starting at the current index.- Returns:
trueif the givensubstringoccurred and has been passed andfalseif the end of the string has been reached without any occurrence of the givensubstring.
-
skipOver
This method reads allnext charactersuntil the givensubstringhas been detected.
After the call of this method, the current index will point to the next character after the first occurrence ofsubstringor to the end of data if the givensubstringwas NOT found.- Parameters:
substring- is the substring to search and skip over starting at the current index.ignoreCase- - iftruethe case of the characters is ignored when compared with characters fromsubstring.- Returns:
trueif the givensubstringoccurred and has been passed andfalseif the end of the string has been reached without any occurrence of the givensubstring.
-
skipOver
This method consumes allnext charactersuntil the givensubstringhas been detected, a character wasacceptedby the givenCharFilteror the end of data was reached.
After the call of this method this scanner will point to the next character after the first occurrence ofsubstring, to the stop character or to end of data.- Parameters:
substring- is the substring to search and skip over starting at the current index.ignoreCase- - iftruethe case of the characters is ignored when compared with characters fromsubstring.stopFilter- is the filter used todetectstop characters. If such character was detected, the skip is stopped and the parser points to the character after the stop character. Thesubstringshould NOT contain astop character.- Returns:
trueif the givensubstringoccurred and has been passed andfalseif a stop character has been detected or the end of the string has been reached without any occurrence of the givensubstringor stop character.
-
skipWhile
int skipWhile(char c) This method reads allnext charactersthat are identical to the character given byc.
E.g. usereadWhile(' ')to skip all blanks from the current index. After the call of this method, the current index will point to the next character that is different to the given charactercor to the end if NO such character exists.- Parameters:
c- is the character to read over.- Returns:
- the number of characters that have been skipped.
-
skipWhile
This method reads allnext charactersthat areacceptedby the givenfilter.
After the call of this method, the current index will point to the next character that was NOTacceptedby the givenfilteror to the end if NO such character exists. -
skipWhile
This method reads allnext charactersthat areacceptedby the givenfilter.
After the call of this method, the current index will point to the next character that was NOTacceptedby the givenfilter. If the nextmaxcharacters or the characters left until theendof this scanner areaccepted, only that amount of characters are skipped.- Parameters:
filter- is used todecidewhich characters should be accepted.max- is the maximum number of characters that may be skipped.- Returns:
- the number of skipped characters.
- See Also:
-
skipWhileAndPeek
- Parameters:
filter- is used todecidewhich characters should be accepted.- Returns:
- the first character that was not
acceptedby the givenCharFilter. Only theacceptedcharacters have been consumed, this scanner still points to the returned character.
-
skipWhileAndPeek
- Parameters:
filter- is used todecidewhich characters should be accepted.max- is the maximum number of characters that may be skipped.- Returns:
- the first character that was not
acceptedby the givenCharFilter. Only theacceptedcharacters have been consumed, this scanner still points to the returned character.
-
readLine
-
readLine
-
readJavaStringLiteral
-
readJavaStringLiteral
-
readJavaCharLiteral
Reads and parses a JavaCharacterliteral value according to JLS 3.10.6.
Examples are given in the following table:literal result comment 'a'a regular char '\''' escaped char '\176'~ escaped octal representation '•'• escaped unicode representation -
readJavaCharLiteral
Reads and parses a JavaCharacterliteral value according to JLS 3.10.6.
Examples are given in the following table:literal result comment 'a'a regular char '\''' escaped char '\176'~ escaped octal representation '•'• escaped unicode representation -
getBufferParsed
String getBufferParsed()- Returns:
- the
Stringwith the characters that have already been parsed but are still available in the underlying buffer. May be used for debugging or error messages.
-
getBufferToParse
String getBufferToParse()- Returns:
- the
Stringwith the characters that have not yet been parsed but are available in the underlying buffer. May be used for debugging or error messages.
-