fr.ove.openmath.jome.model
Class VariableOrNumber

java.lang.Object
  extended byfr.ove.openmath.jome.model.Node
      extended byfr.ove.openmath.jome.model.FormulaTreeStructure
          extended byfr.ove.openmath.jome.model.Constant
              extended byfr.ove.openmath.jome.model.VariableOrNumber
All Implemented Interfaces:
java.lang.Cloneable, Comparable, ControlListener, java.util.EventListener, Iconifiable, Maskable, Modifiable, java.io.Serializable
Direct Known Subclasses:
AFloat, AnInteger, RequestVariable, Variable

public class VariableOrNumber
extends Constant

Elements in the formula such as variables (letters) and numbers.
VariableOrNumber represents a node in the formula tree. Terminal node, so leaves.

Version:
2.0 24/06/1999
Author:
© 1999 DIRAT Laurent
See Also:
Serialized Form

Constructor Summary
VariableOrNumber()
          The default constructor.
VariableOrNumber(java.lang.String resourceIdentifier, java.lang.String value, boolean isNumber, boolean isInteger)
          The Constructor.
 
Method Summary
 java.lang.String createLinear(java.lang.String linear)
          The Creation of the corresponding linear expression of the formula.
 FormulaTreeStructure insert(FormulaTreeStructure current)
          Inserts the operator instance in the formula tree, from the current insertion position.
 boolean isInteger()
          Returns true if it is an integer.
 boolean isNumber()
          Returns true if it is a number.
 boolean isRequestVariable()
          Returns true if it is a request variable.
 void setIsInteger(boolean isInteger)
          Sets the constant, which is a number, as an integer or as a float.
 void setIsNumber(boolean isNumber)
          Sets the constant as a number.
 void setIsRequestVariable(boolean isRequestVariable)
          Sets the constant as a request variable.
 
Methods inherited from class fr.ove.openmath.jome.model.Constant
evaluate, getValue, isIconifiable, isOperator, setValue
 
Methods inherited from class fr.ove.openmath.jome.model.FormulaTreeStructure
addModelListener, consumeControlEvent, findLocation, fireModelEvent, getAreOperandsMovable, getAsOperandPriority, getAsOperatorPriority, getCrossRef, getIconName, getListeners, getResourceIdentifier, goTo, iconify, isEqual, isGreater, isGreaterOrEqual, isIcon, isLesser, isLesserOrEqual, isTemplate, isVisible, moveOperands, removeAllModelListener, removeModelListener, setAreOperandsMovable, setAsOperandPriority, setAsOperatorPriority, setCrossRef, setIconName, setIsIconifiable, setIsTemplate, setIsVisble, setResourceIdentifier, 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
 

Constructor Detail

VariableOrNumber

public VariableOrNumber()
The default constructor.
Constructs a template.


VariableOrNumber

public VariableOrNumber(java.lang.String resourceIdentifier,
                        java.lang.String value,
                        boolean isNumber,
                        boolean isInteger)
The Constructor.

Parameters:
value - the value of the constant.
isNumber - to set if the constant is a number or not.
isInteger - to set, if the constant is a numbern if it is an integer or a float.
Method Detail

setIsNumber

public void setIsNumber(boolean isNumber)
Sets the constant as a number.

Parameters:
isNumber - true if it is a number.false otherwise.

isNumber

public boolean isNumber()
Returns true if it is a number.
false otherwise.


setIsInteger

public void setIsInteger(boolean isInteger)
Sets the constant, which is a number, as an integer or as a float.

Parameters:
isInteger - true if it is an integer.false if it is a float.

isInteger

public boolean isInteger()
Returns true if it is an integer.false if it is a float.


setIsRequestVariable

public void setIsRequestVariable(boolean isRequestVariable)
Sets the constant as a request variable.


isRequestVariable

public boolean isRequestVariable()
Returns true if it is a request variable.
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).

Overrides:
insert in class Constant
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.

Overrides:
createLinear in class Constant


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