Class ClassNode


  • public class ClassNode
    extends Object
    A class in the hierarchy graph together with its supertypes and subtypes.
    • Constructor Detail

      • ClassNode

        public ClassNode​(String name,
                         ClassFile classFile)
        Creates a class node for a class in the ClassPool.
        Parameters:
        name - The internal class name
        classFile - The ClassFile, or null if external (not in pool)
    • Method Detail

      • getName

        public String getName()
        Returns:
        the name
      • getClassFile

        public ClassFile getClassFile()
        Returns:
        the class file
      • isInPool

        public boolean isInPool()
        Returns:
        true when a class file is attached, false for a class outside the pool
      • getSuperClass

        public ClassNode getSuperClass()
        Returns:
        the super class
      • getInterfaces

        public List<ClassNode> getInterfaces()
        Returns:
        an unmodifiable view of the directly implemented interfaces
      • getSubClasses

        public List<ClassNode> getSubClasses()
        Returns:
        an unmodifiable view of the direct subclasses
      • getImplementors

        public List<ClassNode> getImplementors()
        Returns:
        an unmodifiable view of the classes implementing this interface
      • isInterface

        public boolean isInterface()
        Returns:
        true when the attached class file carries ACC_INTERFACE, false when there is none
      • getAllAncestors

        public Set<ClassNode> getAllAncestors()
        Walks superclasses and interfaces transitively.
        Returns:
        every ancestor, in discovery order, excluding this node
      • getAllDescendants

        public Set<ClassNode> getAllDescendants()
        Walks subclasses and implementors transitively.
        Returns:
        every descendant, in discovery order, excluding this node
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object