Package org.jtool.cfg
Class BasicBlock
java.lang.Object
org.jtool.cfg.BasicBlock
An object storing information about a basic block of a CFG.
-
Constructor Summary
ConstructorsConstructorDescriptionBasicBlock
(CFGNode node) Creates a new, empty object for storing the basic block having a given leader node. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a CFG node to this basic block.boolean
Tests if this basic block contains a given CFG node.boolean
boolean
equals
(BasicBlock block) Tests if a given basic block is equal to this basic block.long
getId()
Returns the identification number for this basic block.Returns the leader node for this basic block.getNodes()
Returns nodes contained in this basic block.toString()
Obtains information on this basic block.
-
Constructor Details
-
BasicBlock
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
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
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
Returns nodes contained in this basic block.- Returns:
- the ordered list of the contained nodes
-
contains
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, otherwisefalse
-
equals
-
equals
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
Obtains information on this basic block.
-