Class XOperatorTable

  • All Implemented Interfaces:
    JepComponent, OperatorTableI, java.io.Serializable

    public class XOperatorTable
    extends StandardOperatorTable2
    An operator table to use in the XJep. As the StandardOperatorTable2 but uses the symbolic assignment function XAssign. 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
    • 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 assignment XAssign
        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 this
        xassignSym - symbol used for new assignment operator
    • Method Detail

      • 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 class StandardOperatorTable2
        See Also:
        OperatorTable2.SpecialOperators
      • 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 the EmptyOperatorTable.threadSafeMapCopy() method to return a copy of the map of operators and a constructor taking this map which uses the EmptyOperatorTable(Map) constructor.
        Specified by:
        shallowCopy in interface OperatorTableI
        Overrides:
        shallowCopy in class StandardOperatorTable2
        Returns:
        a new Table