Package org.jtool.pdg

Class PDGNode

Direct Known Subclasses:
ClDGEntry, PDGEntry, PDGStatement

public class PDGNode extends GraphNode
A node of PDGs, ClDGs, and SDG.
  • Field Details

    • cfgnode

      protected final CFGNode cfgnode
      The CFG node corresponding to this node.
  • Constructor Details

    • PDGNode

      protected PDGNode(CFGNode node)
      Creates a new object that represents a PDG node. This method is not intended to be invoked by clients.
      Parameters:
      node - the CFG node corresponding to this node
  • Method Details

    • getCFGNode

      public CFGNode getCFGNode()
      Returns the CFG node corresponding to this node.
      Returns:
      the corresponding CFG node
    • isStatement

      public boolean isStatement()
      Tests if this represents a statement.
      Returns:
      true if this is a statement node, otherwise false
    • isParameter

      public boolean isParameter()
      Tests if this represents a parameter.
      Returns:
      true if this is a parameter node, otherwise false
    • isBranch

      public boolean isBranch()
      Tests if this node causes branching.
      Returns:
      true if this node causes branching, otherwise false
    • isLoop

      public boolean isLoop()
      Tests if this node causes looping.
      Returns:
      true if this node causes looping, otherwise false
    • isEntry

      public boolean isEntry()
      Tests if this node indicates the entry for a method, a field, or a class.
      Returns:
      true if this is an entry node, otherwise false
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class GraphNode
    • print

      public void print()
      Displays information on this node.
    • toString

      public String toString()
      Obtains information on this node.
      Overrides:
      toString in class GraphNode
      Returns:
      the string representing the information
    • sortNodes

      public static List<PDGNode> sortNodes(Collection<? extends PDGNode> nodes)
      Sorts the list of PDG nodes
      Parameters:
      nodes - the collection of the PDG nodes to be sorted
      Returns:
      the sorted list of the PDG nodes