Class XOperatorTable

All Implemented Interfaces:
JepComponent, OperatorTableI, 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:
  • Field Details

  • Constructor Details

    • XOperatorTable

      public XOperatorTable()
      Constructor with a single assignment operator for symbolic assignment
    • XOperatorTable

      public XOperatorTable(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 whose operators will be copied into this
    • XOperatorTable

      public XOperatorTable(OperatorTable2 oldTable, 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
    • XOperatorTable

      protected XOperatorTable(Map<EmptyOperatorTable.OperatorKey,Operator> newTable)
  • Method Details

    • 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 class StandardOperatorTable2
      See Also:
    • setSpecialPfmcs

      protected void setSpecialPfmcs()
      Description copied from class: StandardOperatorTable2
      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.
      Overrides:
      setSpecialPfmcs in class StandardOperatorTable2
      See Also:
    • setPsudoPfmcs

      protected void setPsudoPfmcs()
      Overrides:
      setPsudoPfmcs in class StandardOperatorTable2
    • setXPfmcs

      protected void setXPfmcs()
    • setXPfmcs

      protected void setXPfmcs(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