Package com.singularsys.extensions.field
Class FieldOperatorTable
- java.lang.Object
-
- com.singularsys.jep.EmptyOperatorTable
-
- com.singularsys.jep.OperatorTable2
-
- com.singularsys.jep.standard.StandardOperatorTable2
-
- com.singularsys.extensions.field.FieldOperatorTable
-
- All Implemented Interfaces:
JepComponent
,OperatorTableI
,java.io.Serializable
- Direct Known Subclasses:
MatrixOperatorTable
public class FieldOperatorTable extends StandardOperatorTable2
An operator table where the standard operators are evaluated using a set of fields.- 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
-
-
Constructor Summary
Constructors Modifier Constructor Description FieldOperatorTable(FieldI field)
Constructor with a single fieldprotected
FieldOperatorTable(FieldI f, java.util.Map<EmptyOperatorTable.OperatorKey,Operator> map)
FieldOperatorTable(OperatorTable2 oldTable, FieldI f)
Decorator constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NaryBinaryFunction
getAddFunction()
LazyLogical
getAndFunction()
BinaryFunction
getDivFunction()
BinaryFunction
getEqFunction()
FieldI
getField()
BinaryFunction
getGeFunction()
BinaryFunction
getGtFunction()
BinaryFunction
getLeFunction()
BinaryFunction
getLtFunction()
BinaryFunction
getModFunction()
NaryBinaryFunction
getMulFunction()
BinaryFunction
getNeFunction()
UnaryFunction
getNegFunction()
UnaryFunction
getNotFunction()
LazyLogical
getOrFunction()
BinaryFunction
getPowFunction()
BinaryFunction
getSubFunction()
protected void
setBasicPfmcs()
Sets the standard set of pfmc's for basic operators.protected void
setPsudoPfmcs()
Does nothing.protected void
setSpecialPfmcs()
Does nothing, prevents parents method being called in copy constructor.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
-
field
protected FieldI field
-
-
Constructor Detail
-
FieldOperatorTable
public FieldOperatorTable(FieldI field)
Constructor with a single field- Parameters:
field
- field
-
FieldOperatorTable
public FieldOperatorTable(OperatorTable2 oldTable, FieldI f)
Decorator constructor. Will use the field for the basic operators,- Parameters:
oldTable
- base operator tablef
- field
-
FieldOperatorTable
protected FieldOperatorTable(FieldI f, java.util.Map<EmptyOperatorTable.OperatorKey,Operator> map)
-
-
Method Detail
-
setSpecialPfmcs
protected void setSpecialPfmcs()
Does nothing, prevents parents method being called in copy constructor.- Overrides:
setSpecialPfmcs
in classStandardOperatorTable2
- See Also:
OperatorTable2.SpecialOperators
-
setPsudoPfmcs
protected void setPsudoPfmcs()
Does nothing.- Overrides:
setPsudoPfmcs
in classStandardOperatorTable2
-
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
-
getField
public FieldI getField()
-
getAddFunction
public NaryBinaryFunction getAddFunction()
-
getSubFunction
public BinaryFunction getSubFunction()
-
getNegFunction
public UnaryFunction getNegFunction()
-
getMulFunction
public NaryBinaryFunction getMulFunction()
-
getDivFunction
public BinaryFunction getDivFunction()
-
getModFunction
public BinaryFunction getModFunction()
-
getPowFunction
public BinaryFunction getPowFunction()
-
getEqFunction
public BinaryFunction getEqFunction()
-
getNeFunction
public BinaryFunction getNeFunction()
-
getGtFunction
public BinaryFunction getGtFunction()
-
getLtFunction
public BinaryFunction getLtFunction()
-
getGeFunction
public BinaryFunction getGeFunction()
-
getLeFunction
public BinaryFunction getLeFunction()
-
getAndFunction
public LazyLogical getAndFunction()
-
getOrFunction
public LazyLogical getOrFunction()
-
getNotFunction
public UnaryFunction getNotFunction()
-
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
-
-