Package jadex.javaparser.javaccimpl
Class ConstantNode
java.lang.Object
jadex.javaparser.javaccimpl.SimpleNode
jadex.javaparser.javaccimpl.ExpressionNode
jadex.javaparser.javaccimpl.ConstantNode
- All Implemented Interfaces:
IParsedExpression,Node,Serializable
Constant node representing a constant value.
- See Also:
-
Field Summary
Fields inherited from class jadex.javaparser.javaccimpl.ExpressionNode
constant, constant_value, expressiontext, imports, static_type, textFields inherited from class jadex.javaparser.javaccimpl.SimpleNode
children, id, parent -
Constructor Summary
ConstructorsConstructorDescriptionConstantNode(jadex.javaparser.javaccimpl.ParserImpl p, int id) Create a node. -
Method Summary
Modifier and TypeMethodDescriptionbooleanTest if two nodes are equal.getValue(jadex.common.IValueFetcher fetcher) Evaluate the expression in the given state with respect to given parameters.inthashCode()Get the hash code for the node.voidSet the constant value.Create a string representation of this node and its subnodes.Create a string representation of this node for dumping in a tree.Methods inherited from class jadex.javaparser.javaccimpl.ExpressionNode
appendText, getConstantValue, getExpressionText, getParameters, getStaticType, getText, getUnboundParameterNodes, isConstant, precompile, precompileTree, setConstant, setConstantValue, setExpressionText, setStaticType, setText, subnodeToString, throwEvaluationException, throwParseException, toStringMethods inherited from class jadex.javaparser.javaccimpl.SimpleNode
dump, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent
-
Constructor Details
-
ConstantNode
public ConstantNode(jadex.javaparser.javaccimpl.ParserImpl p, int id) Create a node.- Parameters:
p- The parser.id- The id.
-
-
Method Details
-
setValue
Set the constant value.- Parameters:
value- The constant value.
-
getValue
Evaluate the expression in the given state with respect to given parameters.- Specified by:
getValuein interfaceIParsedExpression- Specified by:
getValuein classExpressionNode- Parameters:
params- The parameters (string, value pairs), if any.- Returns:
- The value of the term.
-
toPlainString
Create a string representation of this node and its subnodes.- Specified by:
toPlainStringin interfaceNode- Overrides:
toPlainStringin classExpressionNode- Returns:
- A string representation of this node.
-
toString
Create a string representation of this node for dumping in a tree.- Overrides:
toStringin classExpressionNode- Returns:
- A string representation of this node.
-
equals
Test if two nodes are equal.- Overrides:
equalsin classExpressionNode
-
hashCode
public int hashCode()Get the hash code for the node.- Overrides:
hashCodein classExpressionNode
-