-
- All Known Implementing Classes:
AbstractCharStreamScanner,CharReaderScanner,CharSequenceScanner
public interface CharStreamScannerThis is the interface for a scanner that can be used to parse a stream or sequence of characters.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description StringconsumeDecimal()Consumes the characters of a decimal number (double or float).booleanexpect(char expected)This method checks that thecurrent characteris equal to the givenexpectedcharacter.default booleanexpect(String expected)This method skips allnext charactersas long as they equal to the according character of theexpectedstring.booleanexpect(String expected, boolean ignoreCase)This method skips allnext charactersas long as they equal to the according character of theexpectedstring.default booleanexpectStrict(String expected)This method acts asexpect(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)This method acts asexpect(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.charforceNext()Likenext()this method reads the current character and increments the index.charforcePeek()This method reads the current character without incrementing the index.booleanhasNext()This method determines if there is at least one more character available.booleanisEos()booleanisEot()charnext()This method reads the current character and increments the index stepping to the next character.charpeek()This method reads the current character without incrementing the index.Stringread(int count)This method reads the number ofnext charactersgiven bycountand returns them as string.default intreadDigit()This method reads thenext characterif it is a digit.intreadDigit(int radix)This method reads thenext characterif it is a digit within the givenradix.default doublereadDouble()This method reads the double value (decimal number) starting at the current position by reading as many matching characters as available and returns itsparsedvalue.default floatreadFloat()This method reads the float value (decimal number) starting at the current position by reading as many matching characters as available and returns itsparsedvalue.default CharacterreadJavaCharLiteral()Reads and parses a JavaCharacterliteral value according to JLS 3.10.6.CharacterreadJavaCharLiteral(boolean tolerant)Reads and parses a JavaCharacterliteral value according to JLS 3.10.6.default StringreadJavaStringLiteral()Reads and parses a JavaStringliteral value according to JLS 3.10.6.StringreadJavaStringLiteral(boolean tolerant)Reads and parses a JavaStringliteral value according to JLS 3.10.6.default StringreadLine()StringreadLine(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.StringreadUntil(char stop, boolean acceptEot)This method reads allnext charactersuntil the givenstopcharacter or the end is reached.StringreadUntil(char stop, boolean acceptEot, char escape)This method reads allnext charactersuntil the given (un-escaped)stopcharacter or the end is reached.StringreadUntil(char stop, boolean acceptEot, CharScannerSyntax syntax)This method reads allnext charactersuntil the givenstopcharacter or the end of the string to parse is reached.StringreadUntil(CharFilter filter, boolean acceptEot)This method reads allnext charactersuntil the first characteracceptedby the givenfilteror the end is reached.StringreadUntil(CharFilter filter, boolean acceptEot, CharScannerSyntax syntax)This method reads allnext charactersuntil the givenCharFilteracceptsthe current character as stop character or the end of text (EOT) is reached.default StringreadUntil(CharFilter filter, boolean acceptEot, String stop)This method reads allnext charactersuntil the first characteracceptedby the givenfilter, the givenstopStringor the end is reached.default StringreadUntil(CharFilter filter, boolean acceptEot, String stop, boolean ignoreCase)This method reads allnext charactersuntil the first characteracceptedby the givenfilter, the givenstopStringor the end is reached.StringreadUntil(CharFilter filter, boolean acceptEot, 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)StringreadWhile(CharFilter filter, int max)voidrequire(char expected)This method verifies that thecurrent characteris equal to the givenexpectedcharacter.voidrequire(String expected, boolean ignoreCase)This method verifies that theexpectedstring gets consumed from this scanner with respect toignoreCase.intskip(int count)This method skips the number ofnext charactersgiven bycount.default booleanskipOver(String substring)This method reads allnext charactersuntil the givensubstringhas been detected.default booleanskipOver(String substring, boolean ignoreCase)This 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 givenCharFilterorEOTwas 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 toEOT.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:
-
-
-
Method Detail
-
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 text (EOT) has been reached.
-
next
char next()
This method reads the current character and increments the index stepping to the next character. You need tocheckif a character is available before calling this method.- Returns:
- the current character.
-
forceNext
char forceNext()
Likenext()this method reads the current character and increments the index. If there is no characteravailablethis method will do nothing but return'\0'(the NULL character and NOT'0').- Returns:
- the current character or
0if none isavailable.
-
peek
char peek()
This method reads the current character without incrementing the index. You need tocheckif a character is available before calling this method.- Returns:
- the current character.
-
forcePeek
char forcePeek()
This method reads the current character without incrementing the index. If there is no characteravailablethis method will return0(the NULL character and NOT'0').- Returns:
- the current character or
0if none isavailable.
-
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 thecurrent 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 thecurrent characteris no such digit.
-
readLong
long readLong(int maxDigits) throws NumberFormatExceptionThis 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
default double readDouble() throws NumberFormatExceptionThis 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
default float readFloat() throws NumberFormatExceptionThis 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
String read(int count)
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.
-
expect
default boolean expect(String expected)
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.
-
expect
boolean expect(String expected, boolean ignoreCase)
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
default boolean expectStrict(String expected)
This method acts asexpect(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
boolean expectStrict(String expected, boolean ignoreCase)
This method acts asexpect(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.
-
expect
boolean expect(char expected)
This method checks that thecurrent 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.
-
require
void require(String expected, boolean ignoreCase)
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.
expectStrict(expected, ignoreCase)) { throw newIllegalStateException(...); }- Parameters:
expected- is the expected string.ignoreCase- - iftruethe case of the characters is ignored during comparison.
-
require
void require(char expected)
This method verifies that thecurrent 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.
-
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
String readUntil(char stop, boolean acceptEot)
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.acceptEot- iftrueEOTwill be treated asstop, too.- Returns:
- the string with all read characters excluding the
stopcharacter ornullif there was nostopcharacter andacceptEotisfalse.
-
readUntil
String readUntil(CharFilter filter, boolean acceptEot)
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.acceptEot- iftrueifEOTshould be treated like thestopcharacter and the rest of the text will be returned,falseotherwise (to returnnullifEOTwas reached and the scanner has been consumed).- Returns:
- the string with all read characters not
acceptedby the givenCharFilterornullif there was noacceptedcharacter andacceptEotisfalse.
-
readUntil
default String readUntil(CharFilter filter, boolean acceptEot, String stop)
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.acceptEot- iftrueifEOTshould be treated like thestopcharacter and the rest of the text will be returned,falseotherwise (to returnnullifEOTwas 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. IfEOTwas reached without a stop signal the entire rest of the data is returned ornullifacceptEotisfalse.
-
readUntil
default String readUntil(CharFilter filter, boolean acceptEot, String stop, boolean ignoreCase)
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.acceptEot- iftrueifEOTshould be treated like thestopcharacter and the rest of the text will be returned,falseotherwise (to returnnullifEOTwas 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. IfEOTwas reached without a stop signal the entire rest of the data is returned ornullifacceptEotisfalse.
-
readUntil
String readUntil(CharFilter filter, boolean acceptEot, 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.acceptEot- iftrueifEOTshould be treated like thestopcharacter and the rest of the text will be returned,falseotherwise (to returnnullifEOTwas 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. IfEOTwas reached without a stop signal the entire rest of the data is returned ornullifacceptEotisfalse. Thre result will betrimmediftrimistrue.
-
readUntil
String readUntil(char stop, boolean acceptEot, char escape)
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.forceNext(); 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.acceptEot- iftrueEOTwill 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 andacceptEotisfalse.
-
readUntil
String readUntil(char stop, boolean acceptEot, CharScannerSyntax syntax)
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.acceptEot- iftrueEOTwill 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(CharFilter, boolean, CharScannerSyntax)
-
readUntil
String readUntil(CharFilter filter, boolean acceptEot, CharScannerSyntax syntax)
This method reads allnext charactersuntil the givenCharFilteracceptsthe current character as stop character or the end of text (EOT) 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.acceptEot- iftrueEOTwill 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(char, boolean, CharScannerSyntax)
-
readWhile
default String readWhile(CharFilter filter)
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.- Parameters:
filter- is used todecidewhich characters should be accepted.- Returns:
- a string with all characters
acceptedby the givenfilter. Will be the empty string if no character was accepted. - See Also:
skipWhile(CharFilter)
-
readWhile
String readWhile(CharFilter filter, int max)
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:
skipWhile(char)
-
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 theend of the streamwas reached.
-
skipOver
default boolean skipOver(String substring)
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 theEOTif 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
default boolean skipOver(String substring, boolean ignoreCase)
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 theEOTif 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
boolean skipOver(String substring, boolean ignoreCase, CharFilter stopFilter)
This method consumes allnext charactersuntil the givensubstringhas been detected, a character wasacceptedby the givenCharFilterorEOTwas 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 toEOT.- 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
default int skipWhile(CharFilter filter)
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.- Parameters:
filter- is used todecidewhich characters should be accepted.- Returns:
- the number of characters
acceptedby the givenfilterthat have been skipped. - See Also:
skipWhile(char)
-
skipWhile
int skipWhile(CharFilter filter, int max)
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:
skipWhile(char)
-
skipWhileAndPeek
default char skipWhileAndPeek(CharFilter filter)
Behaves like the following code:skipWhile(filter); returnforcePeek();- 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
default char skipWhileAndPeek(CharFilter filter, int max)
Behaves like the following code:skipWhile(filter, max); returnforcePeek();- 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
default String readLine()
-
readLine
String readLine(boolean trim)
-
readJavaStringLiteral
default String readJavaStringLiteral()
-
readJavaStringLiteral
String readJavaStringLiteral(boolean tolerant)
-
readJavaCharLiteral
default Character 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
Character readJavaCharLiteral(boolean tolerant)
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
-
isEot
boolean isEot()
- Returns:
trueif end of text (EOT) is known to have been reached,falseotherwise. The returned result will be almost the same as!but this method will not modify the state of this scanner (read additional data, modify buffers, etc.). However, if the underlying stream is already consumed without returninghasNext()-1to signalEOSthis method may returnfalseeven though the next call ofhasNext()may also returnfalse.
-
isEos
boolean isEos()
- Returns:
trueif the end of stream (EOS) has been reached,falseotherwise. Iftrue(EOS) the internal buffer contains the entire rest of the data to scan in memory. If then also all data is consumed from the buffer,EOThas been reached. For instances of that are not backed by an underlying stream of data (likeCharSequenceScanner) this method will always returntrue.
-
-