calc
Class DoCalc
java.lang.Object
|
+--calc.DoCalc
- public class DoCalc
- extends java.lang.Object
This class takes a string representing an arithmetic expression, a
pair of ranges and performs the calculations for a twodimensional grid
of elements in this range by feeding the operational tree (produced
by ExprParser
) with the apropriate values
- See Also:
ExprParser
Constructor Summary |
DoCalc(java.lang.String expr)
preparses the string, handles it to ExprParser ,
stores the operational tree and keeps record of the Modules
representing the variable z for later insertion (i.e fills
variableCalc with elements of Type
VariableCalc |
Method Summary |
void |
calculate()
iterates over the grid and produces the results, storing them for
retrieval with getValues() |
Complex |
calculateFor(Complex z)
calculates a result for a certain number |
Complex[][] |
getValues()
get the Grid of Values for this Calculation |
static void |
main(java.lang.String[] args)
called by user |
void |
setRange(double[] realRange,
double[] imagRange)
set the range of the grid to be calculated
(default is (-10,10) in each direction) |
void |
setSteps(int steps)
set the number of steps in the grid (default is 30, so 30x30 values
are calculated) |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DEFAULT_STEPS
public static final int DEFAULT_STEPS
DoCalc
public DoCalc(java.lang.String expr)
- preparses the string, handles it to
ExprParser
,
stores the operational tree and keeps record of the Modules
representing the variable z for later insertion (i.e fills
variableCalc
with elements of Type
VariableCalc
setRange
public void setRange(double[] realRange,
double[] imagRange)
- set the range of the grid to be calculated
(default is (-10,10) in each direction)
setSteps
public void setSteps(int steps)
- set the number of steps in the grid (default is 30, so 30x30 values
are calculated)
getValues
public Complex[][] getValues()
- get the Grid of Values for this Calculation
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
calculateFor
public Complex calculateFor(Complex z)
- calculates a result for a certain number
calculate
public void calculate()
- iterates over the grid and produces the results, storing them for
retrieval with
getValues()
main
public static void main(java.lang.String[] args)
- called by user