Class ConstantHandler
- java.lang.Object
-
- com.singularsys.extensions.mathml.parser.AbstractHandler
-
- com.singularsys.extensions.mathml.parser.ConstantHandler
-
- All Implemented Interfaces:
TagHandler
public class ConstantHandler extends AbstractHandler
Handles <cn> elements.- Author:
- Richard Morris
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ConstantHandler.ComplexHandler
Parses complex numbers like<cn type="complex-cartesian">1.23<sep/>4.56</cn>
static class
ConstantHandler.ComplexPolarHandler
Parses complex numbers like<cn type="complex-polar">1.23<sep/>4.56</cn>
static interface
ConstantHandler.ConstantTypeHandler
Methods for individual <cn type="type"> handlersstatic class
ConstantHandler.ENotationHandler
Parses numbers in e-notation like<cn type="e-notation">123<sep/>-2</cn>
static class
ConstantHandler.IntegerHandler
Parses integer numbers like<cn type="integer">123</cn>
static class
ConstantHandler.KnownConstantHandler
Parses constants like<cn type="constant">π</cn>
static class
ConstantHandler.RationalHandler
Parses complex numbers like<cn type="rational">123<sep/>456</cn>
static class
ConstantHandler.RealHandler
Parses real numbers like<cn type="real">1.23</cn>
-
Constructor Summary
Constructors Constructor Description ConstantHandler(Jep jep)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
handle(StackFrame frame, org.xml.sax.Locator loc)
Transform the element, called when a closing tag is encountered.java.lang.String
putConstantElement(java.lang.String key, java.lang.String value)
java.lang.String
putEntity(java.lang.String key, java.lang.String value)
java.lang.String
removeConstantElement(java.lang.Object key)
java.lang.String
removeEntity(java.lang.Object key)
-
Methods inherited from class com.singularsys.extensions.mathml.parser.AbstractHandler
convertChildrenToNodes, convertToNode, getFt, getJep, getNf, getNumf, getOt, jepNodesAsArray, jepNodesToFlatArray, jepNodesToFlatList
-
-
-
-
Field Detail
-
DEBUG
public static final boolean DEBUG
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ConstantHandler
public ConstantHandler(Jep jep)
- Parameters:
jep
-
-
-
Method Detail
-
handle
public java.lang.Object handle(StackFrame frame, org.xml.sax.Locator loc) throws org.xml.sax.SAXParseException
Description copied from interface:TagHandler
Transform the element, called when a closing tag is encountered.- Parameters:
frame
- StackFrame representing the elementloc
- location in input- Returns:
- typically a Node, other types of objects may also be returned when the tag has a special meaning for its parent node.
- Throws:
org.xml.sax.SAXParseException
-
putEntity
public java.lang.String putEntity(java.lang.String key, java.lang.String value)
-
putConstantElement
public java.lang.String putConstantElement(java.lang.String key, java.lang.String value)
-
removeConstantElement
public java.lang.String removeConstantElement(java.lang.Object key)
-
removeEntity
public java.lang.String removeEntity(java.lang.Object key)
-
-