Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.maloi.evolvo.expressiontree
Class Value  view Value download Value.java

java.lang.Object
  extended byorg.maloi.evolvo.expressiontree.ExpressionTree
      extended byorg.maloi.evolvo.expressiontree.Value
All Implemented Interfaces:
java.io.Serializable

public class Value
extends ExpressionTree
implements java.io.Serializable

Terminal node for an expressionTree that stores a double value.


Field Summary
(package private)  double v
          The value being stored.
 
Fields inherited from class org.maloi.evolvo.expressiontree.ExpressionTree
cacheable, cachedValue, operator, params, vp
 
Constructor Summary
Value(double p)
          Class constructor that sets the node's value.
 
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.
 double getValue()
           
 void setParams(ExpressionTree[] dummy)
          Set this node's parameters.
 void setValue(double p)
          Sets the value's value.
 java.lang.String toString()
          Returns the value's value 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

double v
The value being stored.

Constructor Detail

Value

public Value(double p)
Class constructor that sets the node's value.

Method Detail

getValue

public double getValue()

getClone

public ExpressionTree getClone()
Description copied from class: ExpressionTree
Convenience method to retrieve a clone of expressionTree as type expressionTree.

Overrides:
getClone in class ExpressionTree

toString

public java.lang.String toString()
Returns the value's value as a string.

Overrides:
toString in class ExpressionTree

setValue

public void setValue(double p)
Sets the value's value.


getNumParams

public int getNumParams()
Returns the number of parameters this node expects.

Overrides:
getNumParams in class ExpressionTree

getParams

public ExpressionTree[] getParams()
Returns the parameters this node is holding.

Overrides:
getParams in class ExpressionTree

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:
setParams in class ExpressionTree

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:
getMachine in class ExpressionTree

buildMachine

public void buildMachine(org.maloi.evolvo.expressiontree.vm.Machine myMachine)
Overrides:
buildMachine in class ExpressionTree