Package org.jtool.pdg

Class Dependence

All Implemented Interfaces:
DependencyGraphEdge
Direct Known Subclasses:
CD, DD

public class Dependence extends GraphEdge implements DependencyGraphEdge
A dependence edge of PDGs.
  • Field Details

  • Constructor Details

    • Dependence

      public Dependence(PDGNode src, PDGNode dst)
      Creates a new object that represents a dependence edge. This method is not intended to be invoked by clients.
      Parameters:
      src - the source node
      dst - the destination node
  • Method Details

    • isDependence

      public boolean isDependence()
      Tests if this edge represents a dependence.
      Specified by:
      isDependence in interface DependencyGraphEdge
      Returns:
      true if this is a dependence edge, otherwise false
    • getSrcId

      public long getSrcId()
      Returns the identification number of the source node of this edge.
      Specified by:
      getSrcId in interface DependencyGraphEdge
      Overrides:
      getSrcId in class GraphEdge
      Returns:
      the identification number of the source node
    • getDstId

      public long getDstId()
      Returns the identification number of the destination node of this edge.
      Specified by:
      getDstId in interface DependencyGraphEdge
      Overrides:
      getDstId in class GraphEdge
      Returns:
      the identification number of the destination node
    • getSrcNode

      public PDGNode getSrcNode()
      Returns the source node of this dependence edge.
      Specified by:
      getSrcNode in interface DependencyGraphEdge
      Overrides:
      getSrcNode in class GraphEdge
      Returns:
      the source node
    • getDstNode

      public PDGNode getDstNode()
      Returns the source node of this dependence edge.
      Specified by:
      getDstNode in interface DependencyGraphEdge
      Overrides:
      getDstNode in class GraphEdge
      Returns:
      the source node
    • setKind

      public void setKind(DependencyGraphEdge.Kind kind)
      Sets the kind of this dependence edge. This method is not intended to be invoked by clients.
      Specified by:
      setKind in interface DependencyGraphEdge
      Parameters:
      kind - the kind of the dependence edge
    • getKind

      public DependencyGraphEdge.Kind getKind()
      Returns the kind of this dependence edge.
      Specified by:
      getKind in interface DependencyGraphEdge
      Returns:
      the kind of the edge
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class GraphElement
    • equals

      public boolean equals(Dependence dependence)
      Tests if a given dependence edge is equal to this edge.
      Parameters:
      dependence - the dependence edge to be checked
      Returns:
      the true if the given edge is equal to this edge
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class GraphEdge
    • toString

      public String toString()
      Obtains information on this edge.
      Overrides:
      toString in class GraphEdge
      Returns:
      the string representing the information
    • sortEdges

      public static List<Dependence> sortEdges(Collection<? extends Dependence> collection)
      Sorts the list of dependence edges.
      Parameters:
      collection - the list of the dependence edges to be sorted
      Returns:
      the sorted list of the dependence edges