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
,java.io.Serializable
public class XOperatorTable extends StandardOperatorTable2
An operator table to use in the XJep. As theStandardOperatorTable2
but uses the symbolic assignment functionXAssign
. 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:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.singularsys.jep.OperatorTable2
OperatorTable2.BasicOperators, OperatorTable2.PsudoOperators, OperatorTable2.SpecialOperators
-
Nested classes/interfaces inherited from class com.singularsys.jep.EmptyOperatorTable
EmptyOperatorTable.OperatorKey
-
-
Field Summary
Fields Modifier and Type Field Description static EmptyOperatorTable.OperatorKey
XASSIGN
-
Constructor Summary
Constructors Modifier Constructor Description XOperatorTable()
Constructor with a single assignment operator for symbolic assignmentXOperatorTable(OperatorTable2 oldTable)
Decorator constructor.XOperatorTable(OperatorTable2 oldTable, java.lang.String xassignSym)
Adds a new operator for symbolic assignment in addition to normal assignment.XOperatorTable(java.lang.String xassignSym)
Constructor with two assignment operators, the standard numerical assignment and a new symbolic assignment operatorprotected
XOperatorTable(java.util.Map<EmptyOperatorTable.OperatorKey,Operator> newTable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Operator
getXAssign()
If there are two operators, one for normal assignment and one for assignment using equations, then this returns the latter.protected void
setBasicPfmcs()
Sets the standard set of pfmc's for basic operators.protected void
setPsudoPfmcs()
protected void
setSpecialPfmcs()
Sets the standard set of pfmc's for special operators assignment, dot product, cross product, list operator and the element of operator.protected void
setXPfmcs()
protected void
setXPfmcs(java.lang.String xassignSym)
OperatorTableI
shallowCopy()
Create 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, getUPlus
-
Methods inherited from class com.singularsys.jep.EmptyOperatorTable
addOperator, addOperator, addOperator, appendOperator, appendOperator, entrySet, getKey, getLightWeightInstance, getNumOps, getOperator, getOperatorMap, getOperators, getOperatorsByName, getOperatorsBySymbol, init, insertOperator, insertOperator, keySet, removeOperator, removeOperator, replaceOperator, replaceOperator, setBinaryInverseOp, setDistributiveOver, setGroupOperatorRelations, setGroupOperatorRelations, setInverseOp, setPrecedenceTable, setRootOp, setStandardOperatorRelations, threadSafeMapCopy, toString
-
-
-
-
Field Detail
-
XASSIGN
public static EmptyOperatorTable.OperatorKey XASSIGN
-
-
Constructor Detail
-
XOperatorTable
public XOperatorTable()
Constructor with a single assignment operator for symbolic assignment
-
XOperatorTable
public XOperatorTable(java.lang.String xassignSym)
Constructor with two assignment operators, the standard numerical assignment and a new symbolic assignment operator- Parameters:
xassignSym
- symbol used for symbolic assignment
-
XOperatorTable
public XOperatorTable(OperatorTable2 oldTable)
Decorator constructor. Replaces the assignment operator's pfmc with symbolic assignmentXAssign
- Parameters:
oldTable
- existing table whos operators will be copied into this
-
XOperatorTable
public XOperatorTable(OperatorTable2 oldTable, java.lang.String xassignSym)
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
protected XOperatorTable(java.util.Map<EmptyOperatorTable.OperatorKey,Operator> newTable)
-
-
Method Detail
-
setBasicPfmcs
protected void setBasicPfmcs()
Description copied from class:StandardOperatorTable2
Sets 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:
setBasicPfmcs
in classStandardOperatorTable2
- See Also:
OperatorTable2.BasicOperators
-
setSpecialPfmcs
protected void setSpecialPfmcs()
Description copied from class:StandardOperatorTable2
Sets the standard set of pfmc's for special operators assignment, dot product, cross product, 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:
setSpecialPfmcs
in classStandardOperatorTable2
- See Also:
OperatorTable2.SpecialOperators
-
setPsudoPfmcs
protected void setPsudoPfmcs()
- Overrides:
setPsudoPfmcs
in classStandardOperatorTable2
-
setXPfmcs
protected void setXPfmcs()
-
setXPfmcs
protected void setXPfmcs(java.lang.String xassignSym)
-
getXAssign
public Operator 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
public OperatorTableI shallowCopy()
Description copied from class:EmptyOperatorTable
Create 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 be@Override public OperatorTableI shallowCopy() { Map<OperatorKey, Operator> map = this.threadSafeMapCopy(); return new MyOperatorTable(map); }
using theEmptyOperatorTable.threadSafeMapCopy()
method to return a copy of the map of operators and a constructor taking this map which uses theEmptyOperatorTable(Map)
constructor.- Specified by:
shallowCopy
in interfaceOperatorTableI
- Overrides:
shallowCopy
in classStandardOperatorTable2
- Returns:
- a new Table
-
-