|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.webcompmath.data.ValueMath
public class ValueMath
A ValueMath object is an easy way to create Value objects that are computed from other Value objects. For example, "new ValueMath(a,b,'+')" is an object whose value is obtained by adding the values of a and b.
Constructor Summary | |
---|---|
ValueMath()
Default constructor, only used in GUI builders. |
|
ValueMath(Function f,
Value x)
Create a ValueMath object whose value is computed as f(x). |
|
ValueMath(Value x,
Value y,
char op)
Create a ValueMath object whose value is computed by applying an arithmetic operator the values of x and y. |
Method Summary | |
---|---|
double |
getVal()
Get the value of this object. |
void |
setFunction(Function f)
Set the function to use |
void |
setop(char op)
Set the operation to use |
void |
setX(Value x)
Set the X value to use |
void |
setY(Value y)
Set the Y value to use |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ValueMath(Value x, Value y, char op)
x
- first arg. valuey
- second arg. valueop
- The arithmetic operator that is to be applied to x and y. This
should be one of the characters '+', '-', '*', '/', or '^'.
(No error is thrown if another character is provided. It will
be treated as a '/').public ValueMath(Function f, Value x)
f
- function to usex
- value to usepublic ValueMath()
Method Detail |
---|
public void setX(Value x)
x
- the value to usepublic void setY(Value y)
y
- the value to usepublic void setop(char op)
op
- the operation to usepublic void setFunction(Function f)
f
- the function to usepublic double getVal()
getVal
in interface Value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |