|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectvmm.functions.Variable
public class Variable
A real-valued variable. A Variable can be added to a Parser
so that it can be used in the defintion of functions and expressions
that are parsed by that parser. It is possible to change the value
of a variable with the setVal(double) method, which will
affect the value of any expressions and functions in which it is used.
| Constructor Summary | |
|---|---|
Variable(double x)
Create a Variable with a specified initial value and with name initially equal to null. |
|
Variable(java.lang.String name)
Create a variable with initial value zero. |
|
Variable(java.lang.String name,
double x)
Create a variable with a specified name and initial value. |
|
| Method Summary | |
|---|---|
java.lang.String |
getName()
Gets the name of this variable. |
double |
getVal()
Returns the current value of this variable. |
void |
setName(java.lang.String name)
Sets the name of this variable. |
void |
setVal(double x)
Sets the value of this variable. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Variable(java.lang.String name,
double x)
name - the name of the variable. This can be null. If the variable is
to be added to a Parser, then the name must be non-null and should be
a legal identifier (starting with a letter and containing only letters,
digits and the underscore character).x - the initial value of the variable.public Variable(java.lang.String name)
public Variable(double x)
| Method Detail |
|---|
public double getVal()
public void setVal(double x)
public java.lang.String getName()
public void setName(java.lang.String name)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||