calc
Class VariableCalc

java.lang.Object
  |
  +--calc.BaseCalc
        |
        +--calc.VariableCalc

public class VariableCalc
extends BaseCalc

Represents a Variable in the Calc-Scheme. Variables are (like Numerals) leaves in the operation tree, therefore they simply return the value which was set in setValue()


Fields inherited from class calc.BaseCalc
calculated, children, result
 
Constructor Summary
VariableCalc()
           
 
Method Summary
protected  void doCalculate()
          does nothing, since the result is already set in Constructor
 int getArgsNr()
          overridden by inheriting class, needed for consistency-checks
 java.lang.String getArithmeticSymbol()
          must be implemented for debugging purposes: returns "+" for AddCalc, etc.
 boolean getSign()
          Returns the sign of the variable true means positive value, false negative
 void setSign(boolean inSign)
          used by ExprParser if "-z" is encountered
 void setValue(Complex value)
          set the value of the variable.
 
Methods inherited from class calc.BaseCalc
calculate, clear, getChildren, insertChildren, main, result, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VariableCalc

public VariableCalc()
Method Detail

getArgsNr

public int getArgsNr()
Description copied from class: BaseCalc
overridden by inheriting class, needed for consistency-checks
Overrides:
getArgsNr in class BaseCalc

setValue

public void setValue(Complex value)
set the value of the variable. This method is called for every element of the definition lattice, when the Values are calculated

getSign

public boolean getSign()
Returns the sign of the variable true means positive value, false negative

setSign

public void setSign(boolean inSign)
used by ExprParser if "-z" is encountered

getArithmeticSymbol

public java.lang.String getArithmeticSymbol()
Description copied from class: BaseCalc
must be implemented for debugging purposes: returns "+" for AddCalc, etc.
Overrides:
getArithmeticSymbol in class BaseCalc

doCalculate

protected void doCalculate()
does nothing, since the result is already set in Constructor
Overrides:
doCalculate in class BaseCalc