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 Summary
Constructors Constructor Description OperatorBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.w3c.dom.Element
build(Node node, org.w3c.dom.Document doc, MathMLDocumentBuilder db)
Builds a Element for a jep Node.java.util.Map<Operator,java.lang.String>
getOperators()
The map of standard operatorsjava.util.Map<Operator,MathMLFragmentBuilder>
getSpecialOps()
The map of special operatorsMathMLFragmentBuilder
put(Operator key, MathMLFragmentBuilder value)
Adds a special operator.java.lang.String
put(Operator key, java.lang.String value)
Adds a standard operator.
-
-
-
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 interfaceMathMLFragmentBuilder
- 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 operatorvalue
- 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 operatorvalue
- 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
-
getSpecialOps
public java.util.Map<Operator,MathMLFragmentBuilder> getSpecialOps()
The map of special operators- Returns:
- the map
-
-