com.singularsys.jep.configurableparser.matchers
Class OperatorTokenMatcher

java.lang.Object
  extended by com.singularsys.jep.configurableparser.matchers.OperatorTokenMatcher
All Implemented Interfaces:
TokenMatcher, java.io.Serializable
Direct Known Subclasses:
UpperCaseOperatorTokenMatcher

public class OperatorTokenMatcher
extends java.lang.Object
implements TokenMatcher

TokenMatcher for matching operators from the operator set.

See Also:
Serialized Form

Constructor Summary
OperatorTokenMatcher()
          Default constructor.
 
Method Summary
 void init(Jep j)
          Initializes the map and tokens member from the list of operators in the operator table of the Jep instance.
 void init(OperatorTableI os)
          Initializes the map and tokens member from the list of operators in the operator table.
 Token match(java.lang.String s)
          Quickly checks whether the first characters of the string match any of the supplied operator strings.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OperatorTokenMatcher

public OperatorTokenMatcher()
Default constructor. The operator set is supplied using the init(com.singularsys.jep.Jep) method.

Method Detail

init

public void init(Jep j)
Initializes the map and tokens member from the list of operators in the operator table of the Jep instance.

Specified by:
init in interface TokenMatcher

init

public void init(OperatorTableI os)
Initializes the map and tokens member from the list of operators in the operator table.

Parameters:
os - the operator table to initialize with.

match

public Token match(java.lang.String s)
Quickly checks whether the first characters of the string match any of the supplied operator strings.

Specified by:
match in interface TokenMatcher
Parameters:
s - the string to match against
Returns:
if successful returns the corresponding token, return null if failed to match

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2010 Singular Systems http://www.singularsys.com/jep