Class RegularBlockImpl
- java.lang.Object
-
- org.checkerframework.dataflow.cfg.block.BlockImpl
-
- org.checkerframework.dataflow.cfg.block.SingleSuccessorBlockImpl
-
- org.checkerframework.dataflow.cfg.block.RegularBlockImpl
-
- All Implemented Interfaces:
Block
,RegularBlock
,SingleSuccessorBlock
,org.plumelib.util.UniqueId
public class RegularBlockImpl extends SingleSuccessorBlockImpl implements RegularBlock
Implementation of a regular basic block.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.checkerframework.dataflow.cfg.block.Block
Block.BlockType
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<Node>
contents
Internal representation of the contents.-
Fields inherited from class org.checkerframework.dataflow.cfg.block.SingleSuccessorBlockImpl
flowRule, successor
-
Fields inherited from class org.checkerframework.dataflow.cfg.block.BlockImpl
predecessors, type
-
-
Constructor Summary
Constructors Constructor Description RegularBlockImpl()
Initialize an empty basic block to be filled with contents and linked to other basic blocks later.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addNode(Node t)
Add a node to the contents of this basic block.void
addNodes(java.util.List<? extends Node> ts)
Add multiple nodes to the contents of this basic block.@Nullable Node
getLastNode()
Returns the last node of this block, or null if none.java.util.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).java.lang.String
toString()
-
Methods inherited from class org.checkerframework.dataflow.cfg.block.SingleSuccessorBlockImpl
getFlowRule, getSuccessor, getSuccessors, setFlowRule, setSuccessor
-
Methods inherited from class org.checkerframework.dataflow.cfg.block.BlockImpl
addPredecessor, getPredecessors, getType, getUid, removePredecessor
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.checkerframework.dataflow.cfg.block.Block
getPredecessors, getSuccessors, getType
-
Methods inherited from interface org.checkerframework.dataflow.cfg.block.SingleSuccessorBlock
getFlowRule, getSuccessor, setFlowRule
-
-
-
-
Field Detail
-
contents
protected final java.util.List<Node> contents
Internal representation of the contents.
-
-
Method Detail
-
addNode
public void addNode(Node t)
Add a node to the contents of this basic block.
-
addNodes
public void addNodes(java.util.List<? extends Node> ts)
Add multiple nodes to the contents of this basic block.
-
getNodes
public java.util.List<Node> getNodes()
Returns the nodes contained within this basic block. The list may be empty.The following invariant holds.
forall n in getNodes() :: n.getBlock() == this
This implementation returns an non-empty list.
-
getLastNode
public @Nullable Node getLastNode()
Description copied from interface:Block
Returns the last node of this block, or null if none.- Specified by:
getLastNode
in interfaceBlock
- Returns:
- the last node of this block or
null
-
getRegularSuccessor
public @Nullable BlockImpl getRegularSuccessor()
Description copied from interface:RegularBlock
Returns the regular successor block.- Specified by:
getRegularSuccessor
in interfaceRegularBlock
- Returns:
- the regular successor block
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
isEmpty
public boolean isEmpty()
Description copied from interface:RegularBlock
Is this block empty (i.e., does it not contain any contents).- Specified by:
isEmpty
in interfaceRegularBlock
-
-