public class RegularBlockImpl extends SingleSuccessorBlockImpl implements RegularBlock
Block.BlockType| Modifier and Type | Field and Description |
|---|---|
protected List<Node> |
contents
Internal representation of the contents.
|
flowRule, successorid, lastId, predecessors, type| Constructor and Description |
|---|
RegularBlockImpl()
Initialize an empty basic block to be filled with contents and linked to other basic blocks
later.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addNode(Node t)
Add a node to the contents of this basic block.
|
void |
addNodes(List<? extends Node> ts)
Add multiple nodes to the contents of this basic block.
|
List<Node> |
getContents()
Returns the unmodifiable sequence of
Nodes. |
@Nullable Node |
getLastNode()
Returns the last node of this block, or null if none.
|
List<Node> |
getNodes()
Returns the nodes contained within this basic block.
|
@Nullable BlockImpl |
getRegularSuccessor()
Returns the regular successor block.
|
boolean |
isEmpty()
Is this block empty (i.e., does it not contain any contents).
|
String |
toString() |
getFlowRule, getSuccessor, getSuccessors, setFlowRule, setSuccessoraddPredecessor, getId, getPredecessors, getType, removePredecessorclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFlowRule, getSuccessor, setFlowRulegetId, getPredecessors, getSuccessors, getTypepublic RegularBlockImpl()
public void addNode(Node t)
public void addNodes(List<? extends Node> ts)
public List<Node> getContents()
RegularBlockNodes.getContents in interface RegularBlockNodespublic List<Node> getNodes()
The following invariant holds.
forall n in getNodes() :: n.getBlock() == this
This implementation returns an non-empty list.
public @Nullable Node getLastNode()
BlockgetLastNode in interface Blocknullpublic @Nullable BlockImpl getRegularSuccessor()
RegularBlockgetRegularSuccessor in interface RegularBlockpublic boolean isEmpty()
RegularBlockisEmpty in interface RegularBlock