Class DependencyNode


  • public class DependencyNode
    extends Object
    A dependency-graph node for a single class, tracking its incoming and outgoing dependency edges.
    • Constructor Detail

      • DependencyNode

        public DependencyNode​(String className,
                              ClassFile classFile)
        Creates a node for the given class.
        Parameters:
        className - the class this node represents
        classFile - the parsed class, or null if the class is external to the pool
    • Method Detail

      • getClassName

        public String getClassName()
        Returns:
        the class name
      • getClassFile

        public ClassFile getClassFile()
        Returns:
        the parsed class, or null for classes outside the ClassPool
      • isInPool

        public boolean isInPool()
        Returns:
        true if this class is in the ClassPool (not external)
      • getOutgoingDependencies

        public Set<Dependency> getOutgoingDependencies()
        Returns:
        an unmodifiable view of the outgoing dependency edges
      • getIncomingDependencies

        public Set<Dependency> getIncomingDependencies()
        Returns:
        an unmodifiable view of the incoming dependency edges
      • getDependencies

        public Set<String> getDependencies()
        Collects the names of the classes this class depends on.
        Returns:
        the depended-upon class names
      • getDependents

        public Set<String> getDependents()
        Collects the names of the classes that depend on this class.
        Returns:
        the dependent class names
      • getDependencyCount

        public int getDependencyCount()
        Returns:
        the number of distinct classes this class depends on
      • getDependentCount

        public int getDependentCount()
        Returns:
        the number of distinct classes that depend on this class
      • getDependenciesByType

        public Set<String> getDependenciesByType​(DependencyType type)
        Collects the classes this class depends on through a specific dependency kind.
        Parameters:
        type - the dependency kind to filter by
        Returns:
        the names of classes reached through that kind
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object