| java.lang.Object edu.hws.jcm.data.ValueMath
ValueMath | public class ValueMath implements Value(Code) | | 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 | |
public | 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.
Parameters: op - The arithmetic operator that is to be applied to x and y. | public | ValueMath(Function f, Value x) Create a ValueMath object whose value is computed as f(x). |
Method Summary | |
public double | getVal() Get the value of this object. |
ValueMath | public ValueMath(Value x, Value y, char op)(Code) | | Create a ValueMath object whose value is computed by applying an arithmetic
operator the values of x and y.
Parameters: op - The arithmetic operator that is to be applied to x and y. This shouldbe one of the characters '+', '-', '*', '/', or '^'. (No error isthrown if another character is provided. It will be treated as a '/'). |
ValueMath | public ValueMath(Function f, Value x)(Code) | | Create a ValueMath object whose value is computed as f(x).
|
getVal | public double getVal()(Code) | | Get the value of this object.
|
|
|