Package io.debezium.text
Interface TokenStream.CharacterStream
-
- All Known Implementing Classes:
TokenStream.CharacterArrayStream
- Enclosing class:
- TokenStream
public static interface TokenStream.CharacterStream
Interface used by aTokenStream.Tokenizer
to iterate through the characters in the content input to theTokenStream
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
hasNext()
Determine if there is another character available in this stream.int
index()
Get the index for the last character returned fromnext()
.boolean
isNext(char c)
Determine if the next character on the sream is the supplied value.boolean
isNext(char nextChar, char followingChar)
Determine if the next two characters on the stream match the supplied values.boolean
isNext(char nextChar, char nextChar2, char nextChar3)
Determine if the next three characters on the sream match the supplied values.boolean
isNextAnyOf(char[] characters)
Determine if the next character on the stream matches one of the supplied characters.boolean
isNextAnyOf(String characters)
Determine if the next character on the stream matches one of the supplied characters.boolean
isNextLetterOrDigit()
Determine if the next character on the stream is aletter or digit
.boolean
isNextValidXmlCharacter()
Determine if the next character on the stream is avalid XML character
.boolean
isNextValidXmlNameCharacter()
Determine if the next character on the sream is avalid XML NCName character
.boolean
isNextValidXmlNcNameCharacter()
Determine if the next character on the sream is avalid XML NCName character
.boolean
isNextWhitespace()
Determine if the next character on the stream is awhitespace character
.char
next()
Obtain the next character value, and advance the stream.Position
position(int startIndex)
Get the position for the last character returned fromnext()
.String
substring(int startIndex, int endIndex)
Get the content from the start position to the end position.
-
-
-
Method Detail
-
hasNext
boolean hasNext()
Determine if there is another character available in this stream.- Returns:
- true if there is another character (and
next()
can be called), or false otherwise
-
next
char next()
Obtain the next character value, and advance the stream.- Returns:
- the next character
- Throws:
NoSuchElementException
- if there is nonext character
-
index
int index()
Get the index for the last character returned fromnext()
.- Returns:
- the index of the last character returned
-
position
Position position(int startIndex)
Get the position for the last character returned fromnext()
.- Parameters:
startIndex
- the starting index- Returns:
- the position of the last character returned; never null
-
substring
String substring(int startIndex, int endIndex)
Get the content from the start position to the end position.- Parameters:
startIndex
- the starting indexendIndex
- the index after the last character to include- Returns:
- the content
-
isNextWhitespace
boolean isNextWhitespace()
Determine if the next character on the stream is awhitespace character
. This method does not advance the stream.- Returns:
- true if there is a
next
character and it is a whitespace character, or false otherwise
-
isNextLetterOrDigit
boolean isNextLetterOrDigit()
Determine if the next character on the stream is aletter or digit
. This method does not advance the stream.- Returns:
- true if there is a
next
character and it is a letter or digit, or false otherwise
-
isNextValidXmlCharacter
boolean isNextValidXmlCharacter()
Determine if the next character on the stream is avalid XML character
. This method does not advance the stream.- Returns:
- true if there is a
next
character and it is a valid XML character, or false otherwise
-
isNextValidXmlNameCharacter
boolean isNextValidXmlNameCharacter()
Determine if the next character on the sream is avalid XML NCName character
. This method does not advance the stream.- Returns:
- true if there is a
next
character and it is a valid XML Name character, or false otherwise
-
isNextValidXmlNcNameCharacter
boolean isNextValidXmlNcNameCharacter()
Determine if the next character on the sream is avalid XML NCName character
. This method does not advance the stream.- Returns:
- true if there is a
next
character and it is a valid XML NCName character, or false otherwise
-
isNext
boolean isNext(char c)
Determine if the next character on the sream is the supplied value. This method does not advance the stream.- Parameters:
c
- the character value to compare to the next character on the stream- Returns:
- true if there is a
next
character and it is the supplied character, or false otherwise
-
isNext
boolean isNext(char nextChar, char followingChar)
Determine if the next two characters on the stream match the supplied values. This method does not advance the stream.- Parameters:
nextChar
- the character value to compare to the next character on the streamfollowingChar
- the character value to compare to the character immediately after the next character on the stream- Returns:
- true if there are at least two characters left on the stream and the first matches
nextChar
and the second matchesfollowingChar
-
isNext
boolean isNext(char nextChar, char nextChar2, char nextChar3)
Determine if the next three characters on the sream match the supplied values. This method does not advance the stream.- Parameters:
nextChar
- the character value to compare to the next character on the streamnextChar2
- the character value to compare to the second character on the streamnextChar3
- the character value to compare to the second character on the stream- Returns:
- true if there are at least two characters left on the stream and the first matches
nextChar
and the second matchesfollowingChar
-
isNextAnyOf
boolean isNextAnyOf(char[] characters)
Determine if the next character on the stream matches one of the supplied characters. This method does not advance the stream.- Parameters:
characters
- the characters to match- Returns:
- true if there is a
next
character and it does match one of the supplied characters, or false otherwise
-
isNextAnyOf
boolean isNextAnyOf(String characters)
Determine if the next character on the stream matches one of the supplied characters. This method does not advance the stream.- Parameters:
characters
- the characters to match- Returns:
- true if there is a
next
character and it does match one of the supplied characters, or false otherwise
-
-