Package com.singularsys.jep
Class OperatorTable2
- java.lang.Object
-
- com.singularsys.jep.EmptyOperatorTable
-
- com.singularsys.jep.OperatorTable2
-
- All Implemented Interfaces:
JepComponent
,OperatorTableI
,java.io.Serializable
- Direct Known Subclasses:
NullWrappedOperatorTable
,StandardOperatorTable2
public class OperatorTable2 extends EmptyOperatorTable
The basic set of operators provided as standard by Jep. Provides the logic but does not specify the actual implementations which is done byStandardOperatorTable2
- Author:
- Richard Morris
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OperatorTable2.BasicOperators
The basic arithmetic comparative and logical operatorsstatic class
OperatorTable2.PsudoOperators
Operators which do not correspond tostatic class
OperatorTable2.SpecialOperators
Special purpose operators-
Nested classes/interfaces inherited from class com.singularsys.jep.EmptyOperatorTable
EmptyOperatorTable.OperatorKey
-
-
Constructor Summary
Constructors Modifier Constructor Description OperatorTable2()
OperatorTable2(OperatorTable2 oldTable)
Decorator constructor.protected
OperatorTable2(java.util.Map<EmptyOperatorTable.OperatorKey,Operator> oldMap)
Constructor with pre-specified table of operators
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Operator
getAdd()
Returns the operator used for addition.Operator
getAnd()
Operator
getAssign()
Operator
getCross()
Operator
getDivide()
Operator
getDot()
Operator
getEle()
Operator
getEQ()
Operator
getGE()
Operator
getGT()
Operator
getLE()
Operator
getList()
Operator
getLT()
Operator
getMod()
Operator
getMultiply()
Operator
getNE()
Operator
getNop()
Operator
getNot()
Operator
getOr()
Operator
getPower()
Operator
getRange()
Operator
getSubtract()
Operator
getUDivide()
unary division i.e. 1/x or x^(-1) *Operator
getUMinus()
Operator
getUPlus()
OperatorTableI
shallowCopy()
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 Detail
-
OperatorTable2
public OperatorTable2()
-
OperatorTable2
public OperatorTable2(OperatorTable2 oldTable)
Decorator constructor. The new class will share the same internal table as its argument.- Parameters:
oldTable
-
-
OperatorTable2
protected OperatorTable2(java.util.Map<EmptyOperatorTable.OperatorKey,Operator> oldMap)
Constructor with pre-specified table of operators- Parameters:
oldMap
- map with existing set of functions- Since:
- 4.0
-
-
Method Detail
-
getNop
public Operator getNop()
- Specified by:
getNop
in interfaceOperatorTableI
- Overrides:
getNop
in classEmptyOperatorTable
-
getAdd
public Operator getAdd()
Description copied from class:EmptyOperatorTable
Returns the operator used for addition.- Specified by:
getAdd
in interfaceOperatorTableI
- Overrides:
getAdd
in classEmptyOperatorTable
-
getSubtract
public Operator getSubtract()
- Specified by:
getSubtract
in interfaceOperatorTableI
- Overrides:
getSubtract
in classEmptyOperatorTable
-
getUMinus
public Operator getUMinus()
- Specified by:
getUMinus
in interfaceOperatorTableI
- Overrides:
getUMinus
in classEmptyOperatorTable
-
getUPlus
public Operator getUPlus()
- Specified by:
getUPlus
in interfaceOperatorTableI
- Overrides:
getUPlus
in classEmptyOperatorTable
-
getMultiply
public Operator getMultiply()
- Specified by:
getMultiply
in interfaceOperatorTableI
- Overrides:
getMultiply
in classEmptyOperatorTable
-
getDivide
public Operator getDivide()
- Specified by:
getDivide
in interfaceOperatorTableI
- Overrides:
getDivide
in classEmptyOperatorTable
-
getMod
public Operator getMod()
- Specified by:
getMod
in interfaceOperatorTableI
- Overrides:
getMod
in classEmptyOperatorTable
-
getUDivide
public Operator getUDivide()
unary division i.e. 1/x or x^(-1) *- Specified by:
getUDivide
in interfaceOperatorTableI
- Overrides:
getUDivide
in classEmptyOperatorTable
-
getPower
public Operator getPower()
- Specified by:
getPower
in interfaceOperatorTableI
- Overrides:
getPower
in classEmptyOperatorTable
-
getGT
public Operator getGT()
- Specified by:
getGT
in interfaceOperatorTableI
- Overrides:
getGT
in classEmptyOperatorTable
-
getLT
public Operator getLT()
- Specified by:
getLT
in interfaceOperatorTableI
- Overrides:
getLT
in classEmptyOperatorTable
-
getEQ
public Operator getEQ()
- Specified by:
getEQ
in interfaceOperatorTableI
- Overrides:
getEQ
in classEmptyOperatorTable
-
getLE
public Operator getLE()
- Specified by:
getLE
in interfaceOperatorTableI
- Overrides:
getLE
in classEmptyOperatorTable
-
getGE
public Operator getGE()
- Specified by:
getGE
in interfaceOperatorTableI
- Overrides:
getGE
in classEmptyOperatorTable
-
getNE
public Operator getNE()
- Specified by:
getNE
in interfaceOperatorTableI
- Overrides:
getNE
in classEmptyOperatorTable
-
getAnd
public Operator getAnd()
- Specified by:
getAnd
in interfaceOperatorTableI
- Overrides:
getAnd
in classEmptyOperatorTable
-
getOr
public Operator getOr()
- Specified by:
getOr
in interfaceOperatorTableI
- Overrides:
getOr
in classEmptyOperatorTable
-
getNot
public Operator getNot()
- Specified by:
getNot
in interfaceOperatorTableI
- Overrides:
getNot
in classEmptyOperatorTable
-
getAssign
public Operator getAssign()
- Specified by:
getAssign
in interfaceOperatorTableI
- Overrides:
getAssign
in classEmptyOperatorTable
-
getDot
public Operator getDot()
- Specified by:
getDot
in interfaceOperatorTableI
- Overrides:
getDot
in classEmptyOperatorTable
-
getCross
public Operator getCross()
- Specified by:
getCross
in interfaceOperatorTableI
- Overrides:
getCross
in classEmptyOperatorTable
-
getList
public Operator getList()
- Specified by:
getList
in interfaceOperatorTableI
- Overrides:
getList
in classEmptyOperatorTable
-
getEle
public Operator getEle()
- Specified by:
getEle
in interfaceOperatorTableI
- Overrides:
getEle
in classEmptyOperatorTable
-
getRange
public Operator getRange()
- Specified by:
getRange
in interfaceOperatorTableI
- Overrides:
getRange
in classEmptyOperatorTable
-
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 classEmptyOperatorTable
- Returns:
- a new Table
-
-