Package com.singularsys.extensions.xjep
Class XOperatorTable
java.lang.Object
com.singularsys.jep.EmptyOperatorTable
com.singularsys.jep.OperatorTable2
com.singularsys.jep.standard.StandardOperatorTable2
com.singularsys.extensions.xjep.XOperatorTable
- All Implemented Interfaces:
JepComponent,OperatorTableI,Serializable
An operator table to use in the XJep. As the
StandardOperatorTable2
but uses the symbolic assignment function XAssign.
The table can be configured in two ways:
- two different assignment operations, one for numerical assignment and one for symbolic assignment.
- A single assignment operator which always does symbolic assignment
- Since:
- Jep 3.5 / Extensions 2.0
- Author:
- Richard Morris
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.singularsys.jep.OperatorTable2
OperatorTable2.BasicOperators, OperatorTable2.PsudoOperators, OperatorTable2.SpecialOperatorsNested classes/interfaces inherited from class com.singularsys.jep.EmptyOperatorTable
EmptyOperatorTable.OperatorKey -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionConstructor with a single assignment operator for symbolic assignmentXOperatorTable(OperatorTable2 oldTable) Decorator constructor.XOperatorTable(OperatorTable2 oldTable, String xassignSym) Adds a new operator for symbolic assignment in addition to normal assignment.XOperatorTable(String xassignSym) Constructor with two assignment operators, the standard numerical assignment and a new symbolic assignment operatorprotectedXOperatorTable(Map<EmptyOperatorTable.OperatorKey, Operator> newTable) -
Method Summary
Modifier and TypeMethodDescriptionIf there are two operators, one for normal assignment and one for assignment using equations, then this returns the latter.protected voidSets the standard set of pfmc's for basic operators.protected voidprotected voidSets the standard set of pfmcs for special operator: assignment, dot product, cross product, the list operator and the element-of operator.protected voidprotected voidCreate a new version of this OperatorTable.Methods inherited from class com.singularsys.jep.OperatorTable2
getAdd, getAnd, getAssign, getCross, getDivide, getDot, getEle, getEQ, getGE, getGT, getLE, getList, getLT, getMod, getMultiply, getNE, getNop, getNot, getOr, getPower, getRange, getSubtract, getUDivide, getUMinus, getUPlusMethods inherited from class com.singularsys.jep.EmptyOperatorTable
addOperator, addOperator, addOperator, appendOperator, appendOperator, entrySet, getAllOperatorsByName, getKey, getKeys, getLightWeightInstance, getNumOps, getOperator, getOperatorByName, getOperatorMap, getOperators, getOperatorsByName, getOperatorsBySymbol, init, insertOperator, insertOperator, keySet, removeOperator, removeOperator, replaceOperator, replaceOperator, setBinaryInverseOp, setDistributiveOver, setGroupOperatorRelations, setGroupOperatorRelations, setInverseOp, setPrecedenceTable, setRootOp, setStandardOperatorRelations, threadSafeMapCopy, toString
-
Field Details
-
XASSIGN
-
-
Constructor Details
-
XOperatorTable
public XOperatorTable()Constructor with a single assignment operator for symbolic assignment -
XOperatorTable
Constructor with two assignment operators, the standard numerical assignment and a new symbolic assignment operator- Parameters:
xassignSym- symbol used for symbolic assignment
-
XOperatorTable
Decorator constructor. Replaces the assignment operator's pfmc with symbolic assignmentXAssign- Parameters:
oldTable- existing table whose operators will be copied into this
-
XOperatorTable
Adds a new operator for symbolic assignment in addition to normal assignment.- Parameters:
oldTable- existing table whose operators will be copied into thisxassignSym- symbol used for new assignment operator
-
XOperatorTable
-
-
Method Details
-
setBasicPfmcs
protected void setBasicPfmcs()Description copied from class:StandardOperatorTable2Sets the standard set of pfmc's for basic operators. This method is called by the constructor and subclasses can override this method to change or prevent building of these pfmcs.- Overrides:
setBasicPfmcsin classStandardOperatorTable2- See Also:
-
setSpecialPfmcs
protected void setSpecialPfmcs()Description copied from class:StandardOperatorTable2Sets the standard set of pfmcs for special operator: assignment, dot product, cross product, the list operator and the element-of operator. This method is called by the constructor and subclasses can override this method to change or prevent building of these pfmcs.- Overrides:
setSpecialPfmcsin classStandardOperatorTable2- See Also:
-
setPsudoPfmcs
protected void setPsudoPfmcs()- Overrides:
setPsudoPfmcsin classStandardOperatorTable2
-
setXPfmcs
protected void setXPfmcs() -
setXPfmcs
-
getXAssign
If there are two operators, one for normal assignment and one for assignment using equations, then this returns the latter.- Returns:
- either null of the second assignment operator
-
shallowCopy
Description copied from class:EmptyOperatorTableCreate a new version of this OperatorTable. Operators are copied into new table. However, Operators whose pfmc implement JepComponent are duplicated. This means the table could be used in a separate thread without problem. Subclasses should override with method to return a table of the correct type, a typical implementation would beusing the@Override public OperatorTableI shallowCopy() { Map<OperatorKey, Operator> map = this.threadSafeMapCopy(); return new MyOperatorTable(map); }EmptyOperatorTable.threadSafeMapCopy()method to return a copy of the map of operators and a constructor taking this map which uses theEmptyOperatorTable(Map)constructor.- Specified by:
shallowCopyin interfaceOperatorTableI- Overrides:
shallowCopyin classStandardOperatorTable2- Returns:
- a new Table
-