An ExpressionNode that stores a constant value. More...


Public Member Functions | |
| ConstantExpressionNode (double value) | |
| Construct with the fixed value. | |
| ConstantExpressionNode (String value) | |
| Convenience constructor that takes a string and converts it to a double before storing the value. | |
| double | getValue () |
| Returns the value of the constant. | |
| int | getType () |
| Returns the type of the node, in this case ExpressionNode.CONSTANT_NODE. | |
| void | accept (ExpressionNodeVisitor visitor) |
| Implementation of the visitor design pattern. | |
Private Attributes | |
| double | value |
| The value of the constant. | |
Additional Inherited Members | |
Static Public Attributes inherited from uk.co.cogitolearning.cogpar.ExpressionNode | |
| static final int | VARIABLE_NODE = 1 |
| Node id for variable nodes. | |
| static final int | CONSTANT_NODE = 2 |
| Node id for constant nodes. | |
| static final int | ADDITION_NODE = 3 |
| Node id for addition nodes. | |
| static final int | MULTIPLICATION_NODE = 4 |
| Node id for multiplication nodes. | |
| static final int | EXPONENTIATION_NODE = 5 |
| Node id for exponentiation nodes. | |
| static final int | FUNCTION_NODE = 6 |
| Node id for function nodes. | |
An ExpressionNode that stores a constant value.
Definition at line 30 of file ConstantExpressionNode.java.
| uk.co.cogitolearning.cogpar.ConstantExpressionNode.ConstantExpressionNode | ( | double | value | ) |
Construct with the fixed value.
| value | the value of the constant |
Definition at line 41 of file ConstantExpressionNode.java.
| uk.co.cogitolearning.cogpar.ConstantExpressionNode.ConstantExpressionNode | ( | String | value | ) |
Convenience constructor that takes a string and converts it to a double before storing the value.
| value | the string representation of the value |
Definition at line 53 of file ConstantExpressionNode.java.
| void uk.co.cogitolearning.cogpar.ConstantExpressionNode.accept | ( | ExpressionNodeVisitor | visitor | ) |
Implementation of the visitor design pattern.
Calls visit on the visitor.
| visitor | the visitor |
Implements uk.co.cogitolearning.cogpar.ExpressionNode.
Definition at line 82 of file ConstantExpressionNode.java.
1.8.1.2