Package com.singularsys.jep.standard
Class StandardOperatorTable2
java.lang.Object
com.singularsys.jep.EmptyOperatorTable
com.singularsys.jep.OperatorTable2
com.singularsys.jep.standard.StandardOperatorTable2
- All Implemented Interfaces:
JepComponent
,OperatorTableI
,Serializable
- Direct Known Subclasses:
BigDecOperatorTable
,BitwiseOperatorTable
,ExtendedOperatorSet
Provides the standard implementations of operators used by Jep.
The logic is specified by the superclass
OperatorTable2
.- Author:
- Richard Morris
- See Also:
-
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
-
Constructor Summary
ModifierConstructorDescriptionCreate the standard set of operators.StandardOperatorTable2
(OperatorTable2 oldTable) Decorator constructor.protected
Constructor with pre-specified table of operators -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Sets the standard set of pfmc's for basic operators.protected void
protected void
Sets the standard set of pfmcs for special operator: assignment, dot product, cross product, the list operator and the element-of operator.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
-
Constructor Details
-
StandardOperatorTable2
public StandardOperatorTable2()Create the standard set of operators. CallssetBasicPfmcs()
,setSpecialPfmcs()
,setPsudoPfmcs()
. -
StandardOperatorTable2
Decorator constructor. Shares the same set of operators as the argument and callssetBasicPfmcs()
,setSpecialPfmcs()
,setPsudoPfmcs()
to assign new PFMC's to the operators.- Parameters:
oldTable
- base table
-
StandardOperatorTable2
Constructor with pre-specified table of operators- Parameters:
oldTable
-
-
-
Method Details
-
setBasicPfmcs
protected void setBasicPfmcs()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.- See Also:
-
setSpecialPfmcs
protected void setSpecialPfmcs()Sets 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.- See Also:
-
setPsudoPfmcs
protected void setPsudoPfmcs() -
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 classOperatorTable2
- Returns:
- a new Table
-