Class 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 Detail

      • OperatorBuilder

        public OperatorBuilder()
    • Method Detail

      • build

        public org.w3c.dom.Element build​(Node node,
                                         org.w3c.dom.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 java.lang.String put​(Operator key,
                                    java.lang.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

        public MathMLFragmentBuilder put​(Operator key,
                                         MathMLFragmentBuilder value)
        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 java.util.Map<Operator,​java.lang.String> getOperators()
        The map of standard operators
        Returns:
        the map