Class VariableBuilder

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

public class VariableBuilder extends Object implements MathMLFragmentBuilder
Builder for jep variables, most variables are represented as <ci>x</ci>. Some jep constant variable (pi,e,i,true,false) have corresponding tags <pi/> etc. in MathML 2.0 these can de defined using putConstant, in MathML 1.0 these were represented as <cn> elements containing named entities like &pi;. There is buggy support for this.
Author:
Richard Morris
  • Constructor Details

    • VariableBuilder

      public VariableBuilder()
  • Method Details

    • build

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

      public String putConstant(String key, String value)
    • putEntity

      public String putEntity(String key, String value)
    • getVersion

      public int getVersion()
      The xml version used. for version 1 predefined constants are represented as entities, for version 2 as xml tags.
      Returns:
      the xml version
    • setVersion

      @Deprecated public void setVersion(int version)
      Deprecated.
      MathML versions not supported.
      This will be used to set the MathML version. Currently deprecated, as entities are not properly supported.
      Parameters:
      version -
    • getConstants

      public Map<String,String> getConstants()
    • getEntities

      public Map<String,String> getEntities()