Package org.apache.flink.util
Class StringValueUtils.WhitespaceTokenizer
- java.lang.Object
-
- org.apache.flink.util.StringValueUtils.WhitespaceTokenizer
-
- All Implemented Interfaces:
Serializable
- Enclosing class:
- StringValueUtils
public static final class StringValueUtils.WhitespaceTokenizer extends Object implements Serializable
A tokenizer for string values that uses whitespace characters as token delimiters. The tokenizer is designed to have a resettable state and operate on mutable objects, sparing object allocation and garbage collection overhead.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WhitespaceTokenizer()
Creates a new tokenizer with an undefined internal state.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
next(StringValue target)
Gets the next token from the string.void
setStringToTokenize(StringValue string)
Sets the string to be tokenized and resets the state of the tokenizer.
-
-
-
Method Detail
-
setStringToTokenize
public void setStringToTokenize(StringValue string)
Sets the string to be tokenized and resets the state of the tokenizer.- Parameters:
string
- The string value to be tokenized.
-
next
public boolean next(StringValue target)
Gets the next token from the string. If another token is available, the token is stored in the given target StringValue object.- Parameters:
target
- The StringValue object to store the next token in.- Returns:
- True, if there was another token, false if not.
-
-