Class OperatorBuilder

java.lang.Object
com.singularsys.extensions.mathml.builder.ApplyConstructor
com.singularsys.extensions.mathml.builder.OperatorBuilder
All Implemented Interfaces:
MathMLFragmentBuilder

public class OperatorBuilder extends ApplyConstructor implements MathMLFragmentBuilder
Builds mathml elements corresponding to operators. For most operators, like x+1 the following xml is produced
<apply><plus/><ci>x<ci/><cn>1<cn/><apply/>
Other operators have special behaviour with their own MathMLFragmentBuilder
Author:
Richard Morris
  • Constructor Details

    • OperatorBuilder

      public OperatorBuilder()
  • Method Details

    • build

      public Element build(Node node, Document doc, MathMLDocumentBuilder db) throws JepException
      Description copied from interface: MathMLFragmentBuilder
      Builds a Element for a jep Node.
      Specified by:
      build in interface MathMLFragmentBuilder
      Parameters:
      node - The jep sub expression.
      doc - The document to create the element in.
      db - Used create elements and attributes and child nodes.
      Returns:
      element representing the node
      Throws:
      JepException
    • put

      public String put(Operator key, String value)
      Adds a standard operator.
      Parameters:
      key - the operator
      value - the name of the mathml element to use for this operator.
      Returns:
      previous value associated with the operator or null
    • put

      Adds a special operator.
      Parameters:
      key - the operator
      value - a builder to create elements for this operator.
      Returns:
      previous value associated with the operator or null
    • getOperators

      public Map<Operator,String> getOperators()
      The map of standard operators
      Returns:
      the map
    • getSpecialOps

      public Map<Operator,MathMLFragmentBuilder> getSpecialOps()
      The map of special operators
      Returns:
      the map