Class NonQuotedLiteralTokenReader
java.lang.Object
ch.andre601.expressionparser.tokens.readers.TokenReader
ch.andre601.expressionparser.tokens.readers.NonQuotedLiteralTokenReader
TokenReader instance
that parses the provided Text by iterating through it until it finds a space
character or hits the end of the text, to then convert into a StringToken instance
.-
Constructor Summary
ConstructorDescriptionNonQuotedLiteralTokenReader
(int priority) Constructor for creating a new NonQuotedLiteralTokenReader. -
Method Summary
Modifier and TypeMethodDescriptionread
(String text, ParsePosition position, ParseWarnCollector collector) Iterates through the provided String until it finds a Whitespace Character at which point it returns a newStringToken
whose value is the retrieved String up until the whitespace character.Methods inherited from class ch.andre601.expressionparser.tokens.readers.TokenReader
getPriority
-
Constructor Details
-
NonQuotedLiteralTokenReader
public NonQuotedLiteralTokenReader(int priority) Constructor for creating a new NonQuotedLiteralTokenReader.- Parameters:
priority
- The priority this TokenReader should have.
-
-
Method Details
-
read
Iterates through the provided String until it finds a Whitespace Character at which point it returns a newStringToken
whose value is the retrieved String up until the whitespace character.
Should the current index end up being larger than the Text length willnull
be returned instead with a Warning added to theParseWarnCollector
.- Specified by:
read
in classTokenReader
- Parameters:
text
- The text to parse.position
- The current position within the text.collector
- Instance of theParseWarnCollector
used for the parsing.- Returns:
- New
StringToken
containing the retrieved text.
-