Class Node
- java.lang.Object
-
- proguard.analysis.datastructure.callgraph.Node
-
public class Node extends java.lang.Object
Represents a node in a sub-callgraph, e.g. only the incoming or the outgoing callgraph for a specific method. SeeCallGraph#reconstructCallGraph(ClassPool, MethodSignature)
for more details. The reconstruction process makes sure that there are no loops in the graph.
-
-
Field Summary
Fields Modifier and Type Field Description java.util.Set<CodeLocation>
incomingCallLocations
TheCodeLocation
s containing the calls in this node's predecessors that lead here.boolean
isTruncated
java.util.Set<CodeLocation>
outgoingCallLocations
TheCodeLocation
s containing the calls in this node that lead to its successors.java.util.Set<Node>
predecessors
MethodSignature
signature
java.util.Set<Node>
successors
-
Constructor Summary
Constructors Constructor Description Node(MethodSignature signature)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.util.Set<Node>
getAllPredecessors()
Get all predecessors of this node.java.util.Set<Node>
getFurthestPredecessors()
Get the predecessor leaf nodes in the call sub-graph represented by this node.java.util.Set<Node>
getFurthestSuccessors()
Get the successor leaf nodes in the call sub-graph represented by this node.int
getPredecessorDepth()
Calculate the distance between this node and its furthest predecessor.int
getSuccessorDepth()
Calculate the distance between this node and its furthest successor.int
hashCode()
boolean
predecessorsContain(MethodSignature signature)
Checks if this node or any predecessors corresponds to a specificMethodSignature
.boolean
successorsContain(MethodSignature signature)
Checks if this node or any successors corresponds to a specificMethodSignature
.
-
-
-
Field Detail
-
signature
public final MethodSignature signature
-
predecessors
public final java.util.Set<Node> predecessors
-
incomingCallLocations
public final java.util.Set<CodeLocation> incomingCallLocations
TheCodeLocation
s containing the calls in this node's predecessors that lead here. If the call graph is traversed strictly in successor direction, there is exactly one incoming call per node, except for the root, which has none.
-
outgoingCallLocations
public final java.util.Set<CodeLocation> outgoingCallLocations
TheCodeLocation
s containing the calls in this node that lead to its successors. If the call graph is traversed strictly in predecessor direction, there is exactly one outgoing call per node, except for the root, which has none.
-
successors
public final java.util.Set<Node> successors
-
isTruncated
public boolean isTruncated
-
-
Constructor Detail
-
Node
public Node(MethodSignature signature)
-
-
Method Detail
-
successorsContain
public boolean successorsContain(MethodSignature signature)
Checks if this node or any successors corresponds to a specificMethodSignature
.- Parameters:
signature
- TheMethodSignature
to look for- Returns:
- true if this node or any of its transitive successors represents the target location
-
predecessorsContain
public boolean predecessorsContain(MethodSignature signature)
Checks if this node or any predecessors corresponds to a specificMethodSignature
.- Parameters:
signature
- TheMethodSignature
to look for- Returns:
- true if this node or any of its transitive predecessors represents the target location
-
getSuccessorDepth
public int getSuccessorDepth()
Calculate the distance between this node and its furthest successor.- Returns:
- The distance (number of hops in the graph)
-
getPredecessorDepth
public int getPredecessorDepth()
Calculate the distance between this node and its furthest predecessor.- Returns:
- The distance (number of hops in the graph)
-
getAllPredecessors
public java.util.Set<Node> getAllPredecessors()
Get all predecessors of this node.
-
getFurthestPredecessors
public java.util.Set<Node> getFurthestPredecessors()
Get the predecessor leaf nodes in the call sub-graph represented by this node.
-
getFurthestSuccessors
public java.util.Set<Node> getFurthestSuccessors()
Get the successor leaf nodes in the call sub-graph represented by this node.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-