Class LambdaResultExpressionNode

  • All Implemented Interfaces:
    org.plumelib.util.UniqueId

    public class LambdaResultExpressionNode
    extends Node
    A node for the single expression body of a single-expression lambda.
    • Field Detail

      • tree

        protected final com.sun.source.tree.ExpressionTree tree
        Tree for the lambda expression body.
      • result

        protected final Node result
        Final CFG node corresponding to the lambda expression body.
    • Constructor Detail

      • LambdaResultExpressionNode

        public LambdaResultExpressionNode​(com.sun.source.tree.ExpressionTree t,
                                          Node result)
        Creates a LambdaResultExpressionNode.
        Parameters:
        t - tree for the lambda expression body
        result - final CFG node corresponding to the lambda expression body
    • Method Detail

      • getResult

        public Node getResult()
        Returns the final node of the CFG corresponding to the lambda expression body (see getTree()).
        Returns:
        the final node of the CFG corresponding to the lambda expression body
      • getTree

        public com.sun.source.tree.ExpressionTree getTree()
        Returns the ExpressionTree corresponding to the body of a lambda expression with an expression body (e.g. X for (o -> X) where X is an expression and not a {...} block).
        Specified by:
        getTree in class Node
        Returns:
        the ExpressionTree corresponding to the body of a lambda expression with an expression body
      • accept

        public <R,​P> R accept​(NodeVisitor<R,​P> visitor,
                                    P p)
        Description copied from class: Node
        Accept method of the visitor pattern.
        Specified by:
        accept in class Node
        Type Parameters:
        R - result type of the operation
        P - parameter type
        Parameters:
        visitor - the visitor to be applied to this node
        p - the parameter for this operation
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(@Nullable java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • getOperands

        @SideEffectFree
        public java.util.Collection<Node> getOperands()
        Description copied from class: Node
        Returns a collection containing all of the operand Nodes of this Node.
        Specified by:
        getOperands in class Node
        Returns:
        a collection containing all of the operand Nodes of this Node