fr.ove.openmath.jome.model
Class Formula

java.lang.Object
  extended byfr.ove.openmath.jome.model.Node
      extended byfr.ove.openmath.jome.model.FormulaTreeStructure
          extended byfr.ove.openmath.jome.model.Formula
All Implemented Interfaces:
java.lang.Cloneable, Comparable, ControlListener, java.util.EventListener, Iconifiable, LinearParserListener, Maskable, Modifiable, java.io.Serializable

public class Formula
extends FormulaTreeStructure
implements LinearParserListener

The formula.
The root of the formula tree structure.

Version:
2.0 28/06/99
Author:
© 2000 DIRAT Laurent
See Also:
Serialized Form

Field Summary
 FormulaTreeStructure current
          The current insertion position in the formula (tree structure).
 
Constructor Summary
Formula()
          The Constructor.
 
Method Summary
 void clear()
          clears the formula.
 void consumeLinearParserEvent(LinearParserEvent linearParserEvent)
          Treats the event received.
 java.lang.String createLinear(java.lang.String linear)
          The Creation of the corresponding linear expression of the formula.
 void doProcess()
          Processes the instance
 java.lang.String evaluate()
          Evaluates the instance.
 boolean getDoProcessing()
          Returns true if the instance needs a processing.
 java.lang.String getLinear()
          Returns the linear expression of the formula.
 java.lang.String getMathML()
          Returns the MathML representation of the formula.
 java.lang.String getOpenMath()
          Returns the OpenMath representation of the formula.
 java.lang.String getPMML()
           
 Processor getProcessor()
          Returns the processor of the instance.
 FormulaTreeStructure insert(FormulaTreeStructure current)
          Inserts the operator instance in the formula tree, from the current insertion position.
 boolean isOperator()
          To check is the instance is an operator.
static void main(java.lang.String[] args)
           
 void setDoProcessing(boolean doProcessing)
          Sets if we had to process the instance before rendering.
 void setProcessor(Processor processor)
          Sets the processor of the instance.
 
Methods inherited from class fr.ove.openmath.jome.model.FormulaTreeStructure
addModelListener, consumeControlEvent, findLocation, fireModelEvent, getAreOperandsMovable, getAsOperandPriority, getAsOperatorPriority, getCrossRef, getIconName, getListeners, getResourceIdentifier, getValue, goTo, iconify, isEqual, isGreater, isGreaterOrEqual, isIcon, isIconifiable, isLesser, isLesserOrEqual, isTemplate, isVisible, moveOperands, removeAllModelListener, removeModelListener, setAreOperandsMovable, setAsOperandPriority, setAsOperatorPriority, setCrossRef, setIconName, setIsIconifiable, setIsTemplate, setIsVisble, setResourceIdentifier, setValue, uniconify, uniconifyAll
 
Methods inherited from class fr.ove.openmath.jome.model.Node
addChild, addChild, clone, computeDepth, computeNbStrahler, duplicate, getChild, getChildren, getDepth, getFather, getNbChildren, getNbStrahler, getRank, hasChild, moveChildren, removeAll, removeChild, removeChild, setFather, setNbStrahler
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

current

public FormulaTreeStructure current
The current insertion position in the formula (tree structure).

Constructor Detail

Formula

public Formula()
The Constructor.

Method Detail

isOperator

public boolean isOperator()
To check is the instance is an operator.

Specified by:
isOperator in class FormulaTreeStructure
Returns:
true if it is an operator. false otherwise.

insert

public FormulaTreeStructure insert(FormulaTreeStructure current)
Inserts the operator instance in the formula tree, from the current insertion position. (checks the priorities and goes up in the tree if necessary).
At the moment, we can't insert a formula in an another formula.

Specified by:
insert in class FormulaTreeStructure
Parameters:
current - the current insertion position.
Returns:
the new insertion position.

createLinear

public java.lang.String createLinear(java.lang.String linear)
The Creation of the corresponding linear expression of the formula.

Specified by:
createLinear in class FormulaTreeStructure

clear

public void clear()
clears the formula.


getLinear

public java.lang.String getLinear()
Returns the linear expression of the formula.


getOpenMath

public java.lang.String getOpenMath()
Returns the OpenMath representation of the formula.


getMathML

public java.lang.String getMathML()
Returns the MathML representation of the formula.


getPMML

public java.lang.String getPMML()

evaluate

public java.lang.String evaluate()
Evaluates the instance.

Specified by:
evaluate in class FormulaTreeStructure

consumeLinearParserEvent

public void consumeLinearParserEvent(LinearParserEvent linearParserEvent)
Treats the event received.

Specified by:
consumeLinearParserEvent in interface LinearParserListener
Parameters:
linearParserEvent - the event received.

setDoProcessing

public void setDoProcessing(boolean doProcessing)
Sets if we had to process the instance before rendering.

Parameters:
doProcessing - true if the instance needs a processing. false otherwise.

getDoProcessing

public boolean getDoProcessing()
Returns true if the instance needs a processing. false otherwise.


setProcessor

public void setProcessor(Processor processor)
Sets the processor of the instance.

Parameters:
processor - the processor.

getProcessor

public Processor getProcessor()
Returns the processor of the instance.


doProcess

public void doProcess()
Processes the instance


main

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


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