Package org.apache.flink.cdc.common.text
Class TokenStream.CharacterArrayStream
- java.lang.Object
-
- org.apache.flink.cdc.common.text.TokenStream.CharacterArrayStream
-
- All Implemented Interfaces:
TokenStream.CharacterStream
- Enclosing class:
- TokenStream
public static final class TokenStream.CharacterArrayStream extends Object implements TokenStream.CharacterStream
An implementation ofTokenStream.CharacterStreamthat works with a single character array.
-
-
Constructor Summary
Constructors Constructor Description CharacterArrayStream(char[] content)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()Determine if there is another character available in this stream.intindex()Get the index for the last character returned fromTokenStream.CharacterStream.next().charnext()Obtain the next character value, and advance the stream.Positionposition(int startIndex)Get the position for the last character returned fromTokenStream.CharacterStream.next().
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
Description copied from interface:TokenStream.CharacterStreamDetermine if there is another character available in this stream.- Specified by:
hasNextin interfaceTokenStream.CharacterStream- Returns:
- true if there is another character (and
TokenStream.CharacterStream.next()can be called), or false otherwise
-
index
public int index()
Description copied from interface:TokenStream.CharacterStreamGet the index for the last character returned fromTokenStream.CharacterStream.next().- Specified by:
indexin interfaceTokenStream.CharacterStream- Returns:
- the index of the last character returned
-
position
public Position position(int startIndex)
Description copied from interface:TokenStream.CharacterStreamGet the position for the last character returned fromTokenStream.CharacterStream.next().- Specified by:
positionin interfaceTokenStream.CharacterStream- Parameters:
startIndex- the starting index- Returns:
- the position of the last character returned; never null
-
next
public char next()
Description copied from interface:TokenStream.CharacterStreamObtain the next character value, and advance the stream.- Specified by:
nextin interfaceTokenStream.CharacterStream- Returns:
- the next character
-
-