QScript  2.1.2
Expression and algorithm evaluator
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Static Public Member Functions | List of all members
org.qscript.operator.OperatorSet Class Reference

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)
 

Detailed Description

A singleton class to manage all available operators.

Author
Peter Lager

Member Function Documentation

void org.qscript.operator.OperatorSet.addOperator ( Operator  op)

Allows user defined operators to be added to the set. This enables customising the script language.

Parameters
op
static OperatorSet org.qscript.operator.OperatorSet.get ( )
static

Get the standard set of operators included. This method is called

Returns
the standard set of operators
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.

Parameters
symbolthe symbol to search for.
Returns
an operator object that matches the symbol or null if no match.
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.

Parameters
symbolthe operator symbol to look for
Returns
true if found else false
void org.qscript.operator.OperatorSet.removeOperator ( String  symbol)

Remove the operator with the specified symbol.

Parameters
symboloperator symbol
static void org.qscript.operator.OperatorSet.set ( OperatorSet  opset)
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.

Parameters
opsetthe set to use, null values are ignored.

The documentation for this class was generated from the following file: