Class VariableBuilder
- java.lang.Object
-
- com.singularsys.extensions.mathml.builder.VariableBuilder
-
- All Implemented Interfaces:
MathMLFragmentBuilder
public class VariableBuilder extends java.lang.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 π. There is buggy support for this.- Author:
- Richard Morris
-
-
Constructor Summary
Constructors Constructor Description VariableBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.w3c.dom.Element
build(Node n, org.w3c.dom.Document d, MathMLDocumentBuilder db)
Builds a Element for a jep Node.java.util.Map<java.lang.String,java.lang.String>
getConstants()
java.util.Map<java.lang.String,java.lang.String>
getEntities()
int
getVersion()
The xml version used.java.lang.String
putConstant(java.lang.String key, java.lang.String value)
java.lang.String
putEntity(java.lang.String key, java.lang.String value)
void
setVersion(int version)
Deprecated.
-
-
-
Method Detail
-
build
public org.w3c.dom.Element build(Node n, org.w3c.dom.Document d, MathMLDocumentBuilder db)
Description copied from interface:MathMLFragmentBuilder
Builds a Element for a jep Node.- Specified by:
build
in interfaceMathMLFragmentBuilder
- 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 java.lang.String putConstant(java.lang.String key, java.lang.String value)
-
putEntity
public java.lang.String putEntity(java.lang.String key, java.lang.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.This will be used to set the MathML version. Currently deprecated as entities are not properly supported.- Parameters:
version
-
-
getConstants
public java.util.Map<java.lang.String,java.lang.String> getConstants()
-
getEntities
public java.util.Map<java.lang.String,java.lang.String> getEntities()
-
-