Public Member Functions | |
void | addOperator (Operator op) |
void | removeOperator (String symbol) |
String | getRegex () |
boolean | hasChanged () |
Operator | getOperator (String symbol) |
boolean | hasOperator (String symbol) |
Set< String > | getSymbols () |
Static Public Member Functions | |
static OperatorSet | get () |
static void | set (OperatorSet opset) |
A singleton class to manage all available operators.
void org.qscript.operator.OperatorSet.addOperator | ( | Operator | op | ) |
Allows user defined operators to be added to the set. This enables customising the script language.
op |
|
static |
Get the standard set of operators included. This method is called
Operator org.qscript.operator.OperatorSet.getOperator | ( | String | symbol | ) |
This creates an instance of the operator with the symbol passed as a parameter value.
Effectively this method provides a copy of the operator held in this operator set.
symbol | the symbol to search for. |
String org.qscript.operator.OperatorSet.getRegex | ( | ) |
Get the regex to match all operators. If the list of operators has changed since the last time this method was called the regex will be recalculated.
Set<String> org.qscript.operator.OperatorSet.getSymbols | ( | ) |
Get a list of the symbols for this operator set. Changes in the list are not reflected in the operator set which remains unchanged.
boolean org.qscript.operator.OperatorSet.hasChanged | ( | ) |
Returns true if the operator set has changed
boolean org.qscript.operator.OperatorSet.hasOperator | ( | String | symbol | ) |
See if the operator set recognizes a symbol.
symbol | the operator symbol to look for |
void org.qscript.operator.OperatorSet.removeOperator | ( | String | symbol | ) |
Remove the operator with the specified symbol.
symbol | operator symbol |
|
static |
This allows you to use your own operator set. The best way to do this is use OperatorSet.get() to get the standard set then add / remove operators to make your own custom set. Then use this method to set it as the default set to use.
Creating and using custom operator sets is advanced stuff, do this at your own risk.
opset | the set to use, null values are ignored. |