Class UnderlyingAST.CFGLambda

  • All Implemented Interfaces:
    org.plumelib.util.UniqueId
    Enclosing class:
    UnderlyingAST

    public static class UnderlyingAST.CFGLambda
    extends UnderlyingAST
    If the underlying AST is a lambda.
    • Constructor Detail

      • CFGLambda

        public CFGLambda​(com.sun.source.tree.LambdaExpressionTree lambda,
                         com.sun.source.tree.ClassTree classTree,
                         @Nullable com.sun.source.tree.MethodTree enclosingMethod)
        Create a new CFGLambda.
        Parameters:
        lambda - the lambda expression
        classTree - the enclosing class of the lambda
        enclosingMethod - the enclosing method of the lambda
    • Method Detail

      • getCode

        public com.sun.source.tree.Tree getCode()
        Description copied from class: UnderlyingAST
        Returns the code that corresponds to the CFG. For a method or lamdda, this returns the body. For other constructs, it returns the tree itself (a statement or expression).
        Specified by:
        getCode in class UnderlyingAST
        Returns:
        the code that corresponds to the CFG
      • getLambdaTree

        public com.sun.source.tree.LambdaExpressionTree getLambdaTree()
        Returns the lambda expression tree.
        Returns:
        the lambda expression tree
      • getClassTree

        public com.sun.source.tree.ClassTree getClassTree()
        Returns the enclosing class of the lambda.
        Returns:
        the enclosing class of the lambda
      • getSimpleClassName

        public java.lang.String getSimpleClassName()
        Returns the simple name of the enclosing class.
        Returns:
        the simple name of the enclosing class
      • getEnclosingMethod

        public @Nullable com.sun.source.tree.MethodTree getEnclosingMethod()
        Returns the enclosing method of the lambda.
        Returns:
        the enclosing method of the lambda, or null if there is no enclosing method
      • getEnclosingMethodName

        public @Nullable java.lang.String getEnclosingMethodName()
        Returns the name of the enclosing method of the lambda.
        Returns:
        the name of the enclosing method of the lambda, or null if there is no enclosing method
      • toString

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