Class CastNode

  • All Implemented Interfaces:
    IParsedExpression, Node, java.io.Serializable

    public class CastNode
    extends ExpressionNode
    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:
    Serialized Form
    • Constructor Detail

      • CastNode

        public CastNode​(jadex.javaparser.javaccimpl.ParserImpl p,
                        int id)
        Create an expression node.
        Parameters:
        p - The parser.
        id - The id.
    • Method Detail

      • precompile

        public void precompile()
        Precompute the static type and check if cast is possible.
        Overrides:
        precompile in class ExpressionNode
      • getValue

        public java.lang.Object getValue​(IValueFetcher fetcher)
        Evaluate the expression in the given state with respect to given parameters.
        Specified by:
        getValue in interface IParsedExpression
        Specified by:
        getValue in class ExpressionNode
        Parameters:
        params - The parameters (string, value pairs), if any.
        Returns:
        The value of the term.
      • toPlainString

        public java.lang.String toPlainString()
        Create a string representation of this node and its subnodes.
        Specified by:
        toPlainString in interface Node
        Overrides:
        toPlainString in class ExpressionNode
        Returns:
        A string representation of this node.