Package jadex.javaparser.javaccimpl
Class CastNode
java.lang.Object
jadex.javaparser.javaccimpl.SimpleNode
jadex.javaparser.javaccimpl.ExpressionNode
jadex.javaparser.javaccimpl.CastNode
- All Implemented Interfaces:
IParsedExpression
,Node
,Serializable
Node representing a cast expression.
A cast node has two children: a type node
representing the static type of the cast,
and an expression, representing the value to cast.
- See Also:
-
Field Summary
Fields inherited from class jadex.javaparser.javaccimpl.ExpressionNode
constant, constant_value, expressiontext, imports, static_type, text
Fields inherited from class jadex.javaparser.javaccimpl.SimpleNode
children, id, parent
-
Constructor Summary
ConstructorsConstructorDescriptionCastNode
(jadex.javaparser.javaccimpl.ParserImpl p, int id) Create an expression node. -
Method Summary
Modifier and TypeMethodDescriptiongetValue
(jadex.common.IValueFetcher fetcher) Evaluate the expression in the given state with respect to given parameters.void
Precompute the static type and check if cast is possible.Create a string representation of this node and its subnodes.Methods inherited from class jadex.javaparser.javaccimpl.ExpressionNode
appendText, equals, getConstantValue, getExpressionText, getParameters, getStaticType, getText, getUnboundParameterNodes, hashCode, isConstant, precompileTree, setConstant, setConstantValue, setExpressionText, setStaticType, setText, subnodeToString, throwEvaluationException, throwParseException, toString, toString
Methods inherited from class jadex.javaparser.javaccimpl.SimpleNode
dump, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent
-
Constructor Details
-
CastNode
public CastNode(jadex.javaparser.javaccimpl.ParserImpl p, int id) Create an expression node.- Parameters:
p
- The parser.id
- The id.
-
-
Method Details
-
precompile
public void precompile()Precompute the static type and check if cast is possible.- Overrides:
precompile
in classExpressionNode
-
getValue
Evaluate the expression in the given state with respect to given parameters.- Specified by:
getValue
in interfaceIParsedExpression
- Specified by:
getValue
in 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:
toPlainString
in interfaceNode
- Overrides:
toPlainString
in classExpressionNode
- Returns:
- A string representation of this node.
-