Class OperatorTokenMatcher
java.lang.Object
com.singularsys.jep.configurableparser.matchers.OperatorTokenMatcher
- All Implemented Interfaces:
TokenMatcher,Serializable
- Direct Known Subclasses:
UpperCaseOperatorTokenMatcher
TokenMatcher for matching operators from the operator set.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidInitializes themapandtokensmember from the list of operators in the operator table of the Jep instance.voidinit(OperatorTableI os) Initializes themapandtokensmember from the list of operators in the operator table.Quickly checks whether the first characters of the string match any of the supplied operator strings.toString()
-
Constructor Details
-
OperatorTokenMatcher
public OperatorTokenMatcher()Default constructor. The operator set is supplied using theinit(com.singularsys.jep.Jep)method.
-
-
Method Details
-
init
Initializes themapandtokensmember from the list of operators in the operator table of the Jep instance.- Specified by:
initin interfaceTokenMatcher- Parameters:
j- Jep instance
-
init
Initializes themapandtokensmember from the list of operators in the operator table.- Parameters:
os- the operator table to initialize with. In Jep 3.5 and later there is one OperatorToken for each alternate symbol.
-
match
Quickly checks whether the first characters of the string match any of the supplied operator strings.- Specified by:
matchin interfaceTokenMatcher- Parameters:
s- the string to match against- Returns:
- if successful returns the corresponding token, return null if failed to match
-
toString
-