Package com.tonic.analysis.dependency
Class DependencyNode
- java.lang.Object
-
- com.tonic.analysis.dependency.DependencyNode
-
public class DependencyNode extends Object
A dependency-graph node for a single class, tracking its incoming and outgoing dependency edges.
-
-
Constructor Summary
Constructors Constructor Description DependencyNode(String className, ClassFile classFile)Creates a node for the given class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)ClassFilegetClassFile()StringgetClassName()Set<String>getDependencies()Collects the names of the classes this class depends on.Set<String>getDependenciesByType(DependencyType type)Collects the classes this class depends on through a specific dependency kind.intgetDependencyCount()intgetDependentCount()Set<String>getDependents()Collects the names of the classes that depend on this class.Set<Dependency>getIncomingDependencies()Set<Dependency>getOutgoingDependencies()inthashCode()booleanisInPool()StringtoString()
-
-
-
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
-
-