|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.simulator.sbml.astnode.ASTNodeValue
public class ASTNodeValue
This class can compute and store the interpreted value (double or boolean) of an ASTNode at the current time. A new computation is only done if the time has changed. So the computation is time-efficient.
Field Summary | |
---|---|
protected boolean |
alreadyProcessed
Flag that tells whether a calculation of the value has already been done (important in the case of constant values) |
protected boolean |
booleanValue
Boolean value of the node (if the type of the value is boolean) |
protected ASTNodeValue[] |
children
The ASTNodeObjects of the child nodes of the corresponding ASTNode |
protected int |
denominator
The denominator of the corresponding ASTNode |
protected double |
doubleValue
Double value of the node (if the type of the value is double) |
protected int |
exponent
The exponent of the corresponding ASTNode |
protected ASTNodeInterpreter |
interpreter
The interpreter for calculating the value |
protected boolean |
isConstant
Flag that is true if the value of the ASTNode is constant. |
protected boolean |
isDouble
Flag that is true if the value has double as type and false if the value is boolean |
protected boolean |
isInfinite
Flag that is true if the value is positive/negative infinity |
protected ASTNodeValue |
leftChild
The ASTNodeObject of the left child of the corresponding ASTNode |
static Logger |
logger
A Logger for this class. |
protected double |
mantissa
The mantissa of the corresponding ASTNode |
protected String |
name
The name of the corresponding ASTNode |
protected ASTNode |
node
The ASTNode this object is referring to |
protected ASTNode.Type |
nodeType
The node type of the corresponding ASTNode |
protected int |
numChildren
The number of children of the corresponding ASTNode |
protected int |
numerator
The numerator of the corresponding ASTNode |
protected double |
real
The real value of the corresponding ASTNode |
protected ASTNodeValue |
rightChild
The ASTNodeObject of the right child of the corresponding ASTNode |
protected double |
time
The time of the last computation |
protected String |
units
The units of the corresponding ASTNode |
Constructor Summary | |
---|---|
ASTNodeValue(ASTNodeInterpreter interpreter,
ASTNode node)
|
Method Summary | |
---|---|
boolean |
compileBoolean(double time)
Computes the boolean value if the time has changed and otherwise returns the already computed value |
double |
compileDouble(double time)
Computes the double value if the time has changed and otherwise returns the already computed value |
protected void |
computeBooleanValue()
Computes the boolean value of the node. |
protected void |
computeDoubleValue()
Computes the double value of the node. |
boolean |
getConstant()
|
String |
getName()
Returns the name of the corresponding ASTNode. |
ASTNode |
getNode()
|
double |
getTime()
|
Object |
getValue(double time)
Returns the value as an object (double or boolean) |
boolean |
isName()
Returns true if the corresponding ASTNode is of type name. |
void |
reset()
Resets the node |
void |
setTime(double time)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double time
protected boolean isConstant
protected boolean isInfinite
protected boolean booleanValue
protected double doubleValue
protected boolean isDouble
protected ASTNode node
protected ASTNode.Type nodeType
protected ASTNodeValue[] children
protected ASTNodeValue leftChild
protected ASTNodeValue rightChild
protected String name
protected int numChildren
protected boolean alreadyProcessed
protected ASTNodeInterpreter interpreter
protected double real
protected double mantissa
protected int exponent
protected int numerator
protected int denominator
protected String units
public static final Logger logger
Logger
for this class.
Constructor Detail |
---|
public ASTNodeValue(ASTNodeInterpreter interpreter, ASTNode node)
interpreter
- node
- Method Detail |
---|
public void reset()
public double getTime()
public void setTime(double time)
time
- public boolean getConstant()
public ASTNode getNode()
public Object getValue(double time)
time
-
public double compileDouble(double time)
time
-
public boolean compileBoolean(double time)
time
-
protected void computeDoubleValue()
protected void computeBooleanValue()
public boolean isName()
public String getName()
|
Generated December 13 2012 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |