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
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
FieldsModifier and TypeFieldDescriptionInternal representation of the contents.Fields inherited from class org.checkerframework.dataflow.cfg.block.SingleSuccessorBlockImpl
flowRule, successorFields inherited from class org.checkerframework.dataflow.cfg.block.BlockImpl
predecessors, type -
Constructor Summary
ConstructorsConstructorDescriptionInitializes an empty basic block to be filled with contents and linked to other basic blocks later. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a node to the contents of this basic block.voidAdds multiple nodes to the contents of this basic block.Returns the last node of this block, or null if none.getNodes()Returns the nodes contained within this basic block.Returns the regular successor block.booleanisEmpty()Returns true if this block is empty (i.e., does not contain any contents).toString()Methods inherited from class org.checkerframework.dataflow.cfg.block.SingleSuccessorBlockImpl
getFlowRule, getSuccessor, getSuccessors, setFlowRule, setSuccessorMethods inherited from class org.checkerframework.dataflow.cfg.block.BlockImpl
addPredecessor, getPredecessors, getType, getUid, removePredecessorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.checkerframework.dataflow.cfg.block.Block
getPredecessors, getSuccessors, getTypeMethods inherited from interface org.checkerframework.dataflow.cfg.block.SingleSuccessorBlock
getFlowRule, getSuccessor, setFlowRuleMethods inherited from interface org.plumelib.util.UniqueId
getClassAndUid, getUid
-
Field Details
-
contents
Internal representation of the contents.
-
-
Constructor Details
-
RegularBlockImpl
public RegularBlockImpl()Initializes an empty basic block to be filled with contents and linked to other basic blocks later.
-
-
Method Details
-
addNode
Adds a node to the contents of this basic block.- Parameters:
n- a node to add to this basic block
-
addNodes
Adds multiple nodes to the contents of this basic block.- Parameters:
ns- the nodes to add to this basic block
-
getNodes
Returns the nodes contained within this basic block. The list can be empty.The following invariant holds.
forall n in getNodes() :: n.getBlock() == this
This implementation returns a non-empty list.
-
getLastNode
Description copied from interface:BlockReturns the last node of this block, or null if none.- Specified by:
getLastNodein interfaceBlock- Returns:
- the last node of this block or
null
-
getRegularSuccessor
Description copied from interface:RegularBlockReturns the regular successor block.- Specified by:
getRegularSuccessorin interfaceRegularBlock- Returns:
- the regular successor block
-
toString
-
isEmpty
public boolean isEmpty()Description copied from interface:RegularBlockReturns true if this block is empty (i.e., does not contain any contents).- Specified by:
isEmptyin interfaceRegularBlock- Returns:
- true if this block is empty
-