|
|||||||||
| Home >> All >> org >> maloi >> evolvo >> [ expressiontree overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.maloi.evolvo.expressiontree
Class Variable

java.lang.Objectorg.maloi.evolvo.expressiontree.ExpressionTree
org.maloi.evolvo.expressiontree.Variable
- All Implemented Interfaces:
- java.lang.Cloneable, java.io.Serializable
- public class Variable
- extends ExpressionTree
- implements java.lang.Cloneable, java.io.Serializable
- extends ExpressionTree
Terminal node for expressionTree that stores a variable.
| Field Summary | |
(package private) java.lang.String |
name
The variable's name. |
(package private) int |
reg
|
(package private) Value |
v
The variable's value. |
| Fields inherited from class org.maloi.evolvo.expressiontree.ExpressionTree |
cacheable, cachedValue, operator, params, vp |
| Constructor Summary | |
Variable()
|
|
Variable(double p,
java.lang.String n)
Class constructor, sets the value (from a double) and name for this variable. |
|
Variable(Value p,
java.lang.String n)
Class constructor, sets the value (from an value object) and name for this variable. |
|
| Method Summary | |
void |
buildMachine(org.maloi.evolvo.expressiontree.vm.Machine myMachine)
|
ExpressionTree |
getClone()
Convenience method to retrieve a clone of expressionTree as type expressionTree. |
org.maloi.evolvo.expressiontree.vm.Machine |
getMachine()
Builds a simple stack machine to evaluate this expression. |
int |
getNumParams()
Returns the number of parameters this node expects. |
ExpressionTree[] |
getParams()
Returns the parameters this node is holding. |
private void |
setName(java.lang.String n)
|
void |
setParams(ExpressionTree[] dummy)
Set this node's parameters. |
void |
setVariable(double p)
Sets the variables value from a double. |
java.lang.String |
toString()
Returns the variable's name as a String. |
| Methods inherited from class org.maloi.evolvo.expressiontree.ExpressionTree |
getName, getOperator, getParamLength, setOperator |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
v
Value v
- The variable's value.
name
java.lang.String name
- The variable's name.
reg
int reg
| Constructor Detail |
Variable
public Variable(double p,
java.lang.String n)
- Class constructor, sets the value (from a double) and name for this
variable.
Variable
public Variable(Value p, java.lang.String n)
- Class constructor, sets the value (from an value object) and name for
this variable.
Variable
public Variable()
| Method Detail |
getClone
public ExpressionTree getClone()
- Description copied from class:
ExpressionTree - Convenience method to retrieve a clone of expressionTree as type
expressionTree.
- Overrides:
getClonein classExpressionTree
toString
public java.lang.String toString()
- Returns the variable's name as a String.
- Overrides:
toStringin classExpressionTree
setVariable
public void setVariable(double p)
- Sets the variables value from a double.
getNumParams
public int getNumParams()
- Returns the number of parameters this node expects.
- Overrides:
getNumParamsin classExpressionTree
getParams
public ExpressionTree[] getParams()
- Returns the parameters this node is holding.
- Overrides:
getParamsin classExpressionTree
setParams
public void setParams(ExpressionTree[] dummy)
- Description copied from class:
ExpressionTree - Set this node's parameters.
Note: Currently does not check that p[] has the correct number of
elements. If p[] has too many elements, the extras are simply thrown
out.
If, however, there are too few, the results are unpredicatable.
This behavior should be modified in future versions to be more robust.
- Overrides:
setParamsin classExpressionTree
getMachine
public org.maloi.evolvo.expressiontree.vm.Machine getMachine()
- Builds a simple stack machine to evaluate this expression.
Simply creates a new machine and passes it on to
the buildMachine(machine) method.
- Overrides:
getMachinein classExpressionTree
buildMachine
public void buildMachine(org.maloi.evolvo.expressiontree.vm.Machine myMachine)
- Overrides:
buildMachinein classExpressionTree
setName
private void setName(java.lang.String n)
|
|||||||||
| Home >> All >> org >> maloi >> evolvo >> [ expressiontree overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC