Class NumberConstantReader
java.lang.Object
ch.andre601.expressionparser.parsers.ValueReader
ch.andre601.expressionparser.parsers.NumberConstantReader
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionread
(ExpressionTemplateParser parser, List<Token> tokens, ParseWarnCollector collector) Takes the first token of thelist of Tokens
and returns aConstantExpressionTemplate
with its double value set from the retrieved Token, if it is aNumberToken
, elsenull
.
-
Constructor Details
-
NumberConstantReader
public NumberConstantReader()
-
-
Method Details
-
read
public ExpressionTemplate read(ExpressionTemplateParser parser, List<Token> tokens, ParseWarnCollector collector) Takes the first token of thelist of Tokens
and returns aConstantExpressionTemplate
with its double value set from the retrieved Token, if it is aNumberToken
, elsenull
.- Specified by:
read
in classValueReader
- Parameters:
parser
- ExpressionTemplateParser instance to use. The default ExpressionTemplateParser provides itself here.tokens
- List of tokens to parse into an ExpressionTemplate.collector
-ParseWarnCollector
instance to use.- Returns:
- Possibly-null
ExpressionTemplate
.
-