Class UnderlyingAST.CFGMethod

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

    public static class UnderlyingAST.CFGMethod
    extends UnderlyingAST
    If the underlying AST is a method.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected com.sun.source.tree.ClassTree classTree
      The class tree this method belongs to.
      protected com.sun.source.tree.MethodTree method
      The method declaration.
    • Constructor Summary

      Constructors 
      Constructor Description
      CFGMethod​(com.sun.source.tree.MethodTree method, com.sun.source.tree.ClassTree classTree)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.sun.source.tree.ClassTree getClassTree()
      Returns the class tree this method belongs to.
      com.sun.source.tree.Tree getCode()
      Returns the code that corresponds to the CFG.
      com.sun.source.tree.MethodTree getMethod()  
      java.lang.String getMethodName()
      Returns the name of the method.
      java.lang.String getSimpleClassName()
      Returns the simple name of the enclosing class.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.plumelib.util.UniqueId

        getClassAndUid
    • Field Detail

      • method

        protected final com.sun.source.tree.MethodTree method
        The method declaration.
      • classTree

        protected final com.sun.source.tree.ClassTree classTree
        The class tree this method belongs to.
    • Constructor Detail

      • CFGMethod

        public CFGMethod​(com.sun.source.tree.MethodTree method,
                         com.sun.source.tree.ClassTree classTree)
    • 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
      • getMethod

        public com.sun.source.tree.MethodTree getMethod()
      • getMethodName

        public java.lang.String getMethodName()
        Returns the name of the method.
        Returns:
        the name of the method
      • getClassTree

        public com.sun.source.tree.ClassTree getClassTree()
        Returns the class tree this method belongs to.
        Returns:
        the class tree this method belongs to
      • getSimpleClassName

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

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