Package com.singularsys.jep
Class OperatorTable2
java.lang.Object
com.singularsys.jep.EmptyOperatorTable
com.singularsys.jep.OperatorTable2
- All Implemented Interfaces:
JepComponent
,OperatorTableI
,Serializable
- Direct Known Subclasses:
NullWrappedOperatorTable
,StandardOperatorTable2
The basic set of operators provided as standard by Jep.
Provides the logic but does not specify the actual implementations
which is done by
StandardOperatorTable2
- Author:
- Richard Morris
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The basic arithmetic comparative and logical operatorsstatic enum
Operators which do not correspond tostatic enum
Special purpose operatorsNested classes/interfaces inherited from class com.singularsys.jep.EmptyOperatorTable
EmptyOperatorTable.OperatorKey
-
Constructor Summary
ModifierConstructorDescriptionOperatorTable2
(OperatorTable2 oldTable) Decorator constructor.protected
Constructor with pre-specified table of operators -
Method Summary
Modifier and TypeMethodDescriptiongetAdd()
Returns the operator used for addition.getAnd()
Gets the operator used for logical ANDGets the operator used for assignmentgetCross()
Gets the operator used for 3D cross productGets the operator used for divisiongetDot()
Gets the operator used for the dot productgetEle()
Gets the operator used for getting and setting elements of a listgetEQ()
Gets the operator used for equalsgetGE()
Gets the operator used for greater than or equals togetGT()
Gets the operator used for greater-thangetLE()
Gets the operator used for less-than or equals togetList()
Gets the operator used for creation of lists[1,2,3]
getLT()
Gets the operator used for less-thangetMod()
Gets the operator used for modulusGets the operator used for multiplicationgetNE()
Gets the operator used for not equalsgetNop()
Gets the no-op operatorgetNot()
Gets the operator used for logical NOTgetOr()
Gets the operator used for logical ORgetPower()
Gets the operator used for powersgetRange()
Gets the operator used for specifying a rangeGets the operator used for subtractionunary division i.e.Gets the operator used for unitary minus-x
getUPlus()
Gets the operator used for unary addition+x
Create a new version of this OperatorTable.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
-
OperatorTable2
public OperatorTable2() -
OperatorTable2
Decorator constructor. The new class will share the same internal table as its argument.- Parameters:
oldTable
-
-
OperatorTable2
Constructor with pre-specified table of operators- Parameters:
oldMap
- map with existing set of functions- Since:
- 4.0
-
-
Method Details
-
getNop
Description copied from interface:OperatorTableI
Gets the no-op operator- Specified by:
getNop
in interfaceOperatorTableI
- Overrides:
getNop
in classEmptyOperatorTable
-
getAdd
Description copied from class:EmptyOperatorTable
Returns the operator used for addition.- Specified by:
getAdd
in interfaceOperatorTableI
- Overrides:
getAdd
in classEmptyOperatorTable
-
getSubtract
Description copied from interface:OperatorTableI
Gets the operator used for subtraction- Specified by:
getSubtract
in interfaceOperatorTableI
- Overrides:
getSubtract
in classEmptyOperatorTable
-
getUMinus
Description copied from interface:OperatorTableI
Gets the operator used for unitary minus-x
- Specified by:
getUMinus
in interfaceOperatorTableI
- Overrides:
getUMinus
in classEmptyOperatorTable
-
getUPlus
Description copied from interface:OperatorTableI
Gets the operator used for unary addition+x
- Specified by:
getUPlus
in interfaceOperatorTableI
- Overrides:
getUPlus
in classEmptyOperatorTable
-
getMultiply
Description copied from interface:OperatorTableI
Gets the operator used for multiplication- Specified by:
getMultiply
in interfaceOperatorTableI
- Overrides:
getMultiply
in classEmptyOperatorTable
-
getDivide
Description copied from interface:OperatorTableI
Gets the operator used for division- Specified by:
getDivide
in interfaceOperatorTableI
- Overrides:
getDivide
in classEmptyOperatorTable
-
getMod
Description copied from interface:OperatorTableI
Gets the operator used for modulus- Specified by:
getMod
in interfaceOperatorTableI
- Overrides:
getMod
in classEmptyOperatorTable
-
getUDivide
unary division i.e. 1/x or x^(-1) *- Specified by:
getUDivide
in interfaceOperatorTableI
- Overrides:
getUDivide
in classEmptyOperatorTable
-
getPower
Description copied from interface:OperatorTableI
Gets the operator used for powers- Specified by:
getPower
in interfaceOperatorTableI
- Overrides:
getPower
in classEmptyOperatorTable
-
getGT
Description copied from interface:OperatorTableI
Gets the operator used for greater-than- Specified by:
getGT
in interfaceOperatorTableI
- Overrides:
getGT
in classEmptyOperatorTable
-
getLT
Description copied from interface:OperatorTableI
Gets the operator used for less-than- Specified by:
getLT
in interfaceOperatorTableI
- Overrides:
getLT
in classEmptyOperatorTable
-
getEQ
Description copied from interface:OperatorTableI
Gets the operator used for equals- Specified by:
getEQ
in interfaceOperatorTableI
- Overrides:
getEQ
in classEmptyOperatorTable
-
getLE
Description copied from interface:OperatorTableI
Gets the operator used for less-than or equals to- Specified by:
getLE
in interfaceOperatorTableI
- Overrides:
getLE
in classEmptyOperatorTable
-
getGE
Description copied from interface:OperatorTableI
Gets the operator used for greater than or equals to- Specified by:
getGE
in interfaceOperatorTableI
- Overrides:
getGE
in classEmptyOperatorTable
-
getNE
Description copied from interface:OperatorTableI
Gets the operator used for not equals- Specified by:
getNE
in interfaceOperatorTableI
- Overrides:
getNE
in classEmptyOperatorTable
-
getAnd
Description copied from interface:OperatorTableI
Gets the operator used for logical AND- Specified by:
getAnd
in interfaceOperatorTableI
- Overrides:
getAnd
in classEmptyOperatorTable
-
getOr
Description copied from interface:OperatorTableI
Gets the operator used for logical OR- Specified by:
getOr
in interfaceOperatorTableI
- Overrides:
getOr
in classEmptyOperatorTable
-
getNot
Description copied from interface:OperatorTableI
Gets the operator used for logical NOT- Specified by:
getNot
in interfaceOperatorTableI
- Overrides:
getNot
in classEmptyOperatorTable
-
getAssign
Description copied from interface:OperatorTableI
Gets the operator used for assignment- Specified by:
getAssign
in interfaceOperatorTableI
- Overrides:
getAssign
in classEmptyOperatorTable
-
getDot
Description copied from interface:OperatorTableI
Gets the operator used for the dot product- Specified by:
getDot
in interfaceOperatorTableI
- Overrides:
getDot
in classEmptyOperatorTable
-
getCross
Description copied from interface:OperatorTableI
Gets the operator used for 3D cross product- Specified by:
getCross
in interfaceOperatorTableI
- Overrides:
getCross
in classEmptyOperatorTable
-
getList
Description copied from interface:OperatorTableI
Gets the operator used for creation of lists[1,2,3]
- Specified by:
getList
in interfaceOperatorTableI
- Overrides:
getList
in classEmptyOperatorTable
-
getEle
Description copied from interface:OperatorTableI
Gets the operator used for getting and setting elements of a list- Specified by:
getEle
in interfaceOperatorTableI
- Overrides:
getEle
in classEmptyOperatorTable
-
getRange
Description copied from interface:OperatorTableI
Gets the operator used for specifying a range- Specified by:
getRange
in interfaceOperatorTableI
- Overrides:
getRange
in classEmptyOperatorTable
-
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 classEmptyOperatorTable
- Returns:
- a new Table
-