fr.ove.openmath.jome.formaters.mml
Class MathMLFormater

java.lang.Object
  extended byfr.ove.utils.FormaterRepository
      extended byfr.ove.openmath.jome.formaters.mml.MathMLFormater
All Implemented Interfaces:
Formater

public class MathMLFormater
extends FormaterRepository

Formats the formula tree structure as its corresponding MathML object.

Version:
1.0 23/05/2000
Author:
© 2000 DIRAT Laurent

Constructor Summary
MathMLFormater()
           
 
Method Summary
 java.lang.String format(java.lang.String formatedObject, FormaterRepository formaterRepository, java.lang.Object obj)
          Returns the specified object formatted as a string.
 java.lang.String getElementName(java.lang.String objectId)
          Returns the element name of the specified property.
 Formater getFormater(java.lang.String objectId)
          Returns the formater with the specified identifier.
 java.lang.String getMathML(FormulaTreeStructure fts)
          Returns the MathML object of the specified formula tree structure.
static void main(java.lang.String[] args)
          Test.
 java.lang.String writeEmptyElement(java.lang.String elementName)
          Writes the empty element with the specified name.
 java.lang.String writeEndApplication()
          Writes the MathML end application tag.
 java.lang.String writeEndBoundVariables()
          Writes the MathML end bound variables tag.
 java.lang.String writeEndElement(java.lang.String elementName)
          Writes the end element with the specified name.
 java.lang.String writeEndLambda()
          Writes the MathML end lambda tag.
 java.lang.String writeEndObject()
          Writes the MathML end object tag.
 java.lang.String writeFloat(java.lang.String value)
          Writes a float (decimal format, not hexa).
 java.lang.String writeIdentifier(java.lang.String value)
          Writes an identifier.
 java.lang.String writeInteger(java.lang.String value)
          Writes an integer (decimal format, not hexa)
 java.lang.String writeStartApplication()
          Writes the MathML start application tag.
 java.lang.String writeStartBoundVariables()
          Writes the MathML start bound variables tag.
 java.lang.String writeStartElement(java.lang.String elementName)
          Writes the start element with the specified name.
 java.lang.String writeStartLambda()
          Writes the MathML start lambda tag.
 java.lang.String writeStartObject()
          Writes the MathML start object tag.
 java.lang.String writeSymbol(java.lang.String objectId)
          Writes the symbol element with the specified identifier.
 
Methods inherited from class fr.ove.utils.FormaterRepository
decIndent, getIndent, incIndent, initIndent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MathMLFormater

public MathMLFormater()
Method Detail

getFormater

public Formater getFormater(java.lang.String objectId)
Returns the formater with the specified identifier.

Specified by:
getFormater in class FormaterRepository
Parameters:
objectId - the object (to format) identifier.

format

public java.lang.String format(java.lang.String formatedObject,
                               FormaterRepository formaterRepository,
                               java.lang.Object obj)
Returns the specified object formatted as a string.

Parameters:
formatedObject - the formatted object (for structured object, could represents the beginning).
obj - the object to format.
formaterRepository - where the different other formaters are.

getElementName

public java.lang.String getElementName(java.lang.String objectId)
Returns the element name of the specified property.

Parameters:
objectId - the object (to format) identifier.

getMathML

public java.lang.String getMathML(FormulaTreeStructure fts)
Returns the MathML object of the specified formula tree structure.

Parameters:
fts - the specified formula tree structure.

writeStartObject

public java.lang.String writeStartObject()
Writes the MathML start object tag.

Returns:
the tag.

writeEndObject

public java.lang.String writeEndObject()
Writes the MathML end object tag.

Returns:
the tag.

writeStartApplication

public java.lang.String writeStartApplication()
Writes the MathML start application tag.

Returns:
the tag.

writeEndApplication

public java.lang.String writeEndApplication()
Writes the MathML end application tag.

Returns:
the tag.

writeStartLambda

public java.lang.String writeStartLambda()
Writes the MathML start lambda tag.

Returns:
the tag.

writeEndLambda

public java.lang.String writeEndLambda()
Writes the MathML end lambda tag.

Returns:
the tag.

writeStartBoundVariables

public java.lang.String writeStartBoundVariables()
Writes the MathML start bound variables tag.

Returns:
the tag.

writeEndBoundVariables

public java.lang.String writeEndBoundVariables()
Writes the MathML end bound variables tag.

Returns:
the tag.

writeFloat

public java.lang.String writeFloat(java.lang.String value)
Writes a float (decimal format, not hexa).

Parameters:
value - the float value.

writeInteger

public java.lang.String writeInteger(java.lang.String value)
Writes an integer (decimal format, not hexa)

Parameters:
value - the integer value.

writeIdentifier

public java.lang.String writeIdentifier(java.lang.String value)
Writes an identifier.

Parameters:
value - the identifier value.

writeSymbol

public java.lang.String writeSymbol(java.lang.String objectId)
Writes the symbol element with the specified identifier.


writeEmptyElement

public java.lang.String writeEmptyElement(java.lang.String elementName)
Writes the empty element with the specified name.

Parameters:
elementName - the name of the element to write.

writeStartElement

public java.lang.String writeStartElement(java.lang.String elementName)
Writes the start element with the specified name.

Parameters:
elementName - the name of the element to write.

writeEndElement

public java.lang.String writeEndElement(java.lang.String elementName)
Writes the end element with the specified name.

Parameters:
elementName - the name of the element to write.

main

public static void main(java.lang.String[] args)
Test.



Copyright © 1999-2007 Universit?© de Nice Sophia-Antipolis, I3S, Ove SARL, DFKI and Universit?§t des Saarlandes. All Rights Reserved.