Package org.jtool.cfg

Class BasicBlock

java.lang.Object
org.jtool.cfg.BasicBlock

public class BasicBlock extends Object
An object storing information about a basic block of a CFG.
  • Constructor Details

    • BasicBlock

      public BasicBlock(CFGNode node)
      Creates a new, empty object for storing the basic block having a given leader node.
      Parameters:
      node - the leader node of this basic block
  • Method Details

    • getLeader

      public CFGNode getLeader()
      Returns the leader node for this basic block.
      Returns:
      the leader node
    • getId

      public long getId()
      Returns the identification number for this basic block.
      Returns:
      the identification number
    • add

      public void add(CFGNode node)
      Adds a CFG node to this basic block. This method is not intended to be invoked by clients.
      Parameters:
      node - the node to be added
    • getNodes

      public List<CFGNode> getNodes()
      Returns nodes contained in this basic block.
      Returns:
      the ordered list of the contained nodes
    • contains

      public boolean contains(CFGNode node)
      Tests if this basic block contains a given CFG node.
      Parameters:
      node - the node to be checked
      Returns:
      true if this basic block contains the node, otherwise false
    • equals

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

      public boolean equals(BasicBlock block)
      Tests if a given basic block is equal to this basic block.
      Parameters:
      block - the basic block to be checked
      Returns:
      the true if the given basic block is equal to this basic block
    • toString

      public String toString()
      Obtains information on this basic block.
      Overrides:
      toString in class Object
      Returns:
      the string representing the information