Class NumberTokenMatcher
java.lang.Object
com.singularsys.jep.configurableparser.matchers.RegExpTokenMatcher
com.singularsys.jep.configurableparser.matchers.NumberTokenMatcher
- All Implemented Interfaces:
TokenBuilder
,TokenMatcher
,Serializable
Matches numbers.
The jep NumberFactory is used to create the number.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuildToken
(String s) Builds a token following a successful match.static NumberTokenMatcher
Factory to create a matcher for decimal number without exponentsstatic NumberTokenMatcher
Factory to create a matcher for decimal number with or without exponentsvoid
Initialize the matcher when the Jep instance is known.Methods inherited from class com.singularsys.jep.configurableparser.matchers.RegExpTokenMatcher
match
-
Constructor Details
-
NumberTokenMatcher
-
NumberTokenMatcher
-
-
Method Details
-
buildToken
Description copied from class:RegExpTokenMatcher
Builds a token following a successful match. Note new objects should be created each time as error reporting information is later attached to tokens.- Specified by:
buildToken
in interfaceTokenBuilder
- Specified by:
buildToken
in classRegExpTokenMatcher
- Parameters:
s
- String representing the completed matched token- Returns:
- the appropriate type of token.
- Throws:
ParseException
-
defaultNumberTokenMatcher
Factory to create a matcher for decimal number without exponents- Returns:
- the matcher
-
exponentNumberTokenMatcher
Factory to create a matcher for decimal number with or without exponents- Returns:
- the matcher
-
init
Description copied from interface:TokenMatcher
Initialize the matcher when the Jep instance is known.- Parameters:
jep
- Jep instance
-