Class ExceptionBlockImpl
- java.lang.Object
-
- org.checkerframework.dataflow.cfg.block.BlockImpl
-
- org.checkerframework.dataflow.cfg.block.SingleSuccessorBlockImpl
-
- org.checkerframework.dataflow.cfg.block.ExceptionBlockImpl
-
- All Implemented Interfaces:
Block
,ExceptionBlock
,SingleSuccessorBlock
,org.plumelib.util.UniqueId
public class ExceptionBlockImpl extends SingleSuccessorBlockImpl implements ExceptionBlock
Implementation ofExceptionBlock
.
-
-
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.Map<javax.lang.model.type.TypeMirror,java.util.Set<Block>>
exceptionalSuccessors
Set of exceptional successors.protected @Nullable Node
node
The node of this block.-
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 ExceptionBlockImpl()
Create an empty exceptional block.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addExceptionalSuccessor(BlockImpl b, javax.lang.model.type.TypeMirror cause)
Add an exceptional successor.java.util.Map<javax.lang.model.type.TypeMirror,java.util.Set<Block>>
getExceptionalSuccessors()
Returns the list of exceptional successor blocks as an unmodifiable map.@Nullable Node
getLastNode()
Returns the last node of this block, or null if none.Node
getNode()
Returns the node of this block.java.util.List<Node>
getNodes()
Returns the nodes contained within this basic block.java.util.Set<Block>
getSuccessors()
Returns the successors of this basic block.void
setNode(Node c)
Set the node.java.lang.String
toString()
-
Methods inherited from class org.checkerframework.dataflow.cfg.block.SingleSuccessorBlockImpl
getFlowRule, getSuccessor, 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, getType
-
Methods inherited from interface org.checkerframework.dataflow.cfg.block.SingleSuccessorBlock
getFlowRule, getSuccessor, setFlowRule
-
-
-
-
Method Detail
-
setNode
public void setNode(Node c)
Set the node.
-
getNode
public Node getNode()
Description copied from interface:ExceptionBlock
Returns the node of this block.- Specified by:
getNode
in interfaceExceptionBlock
- Returns:
- the node of this 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 a singleton 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
-
addExceptionalSuccessor
public void addExceptionalSuccessor(BlockImpl b, javax.lang.model.type.TypeMirror cause)
Add an exceptional successor.- Parameters:
b
- the successorcause
- the exception type that leads to the given block
-
getExceptionalSuccessors
public java.util.Map<javax.lang.model.type.TypeMirror,java.util.Set<Block>> getExceptionalSuccessors()
Description copied from interface:ExceptionBlock
Returns the list of exceptional successor blocks as an unmodifiable map.- Specified by:
getExceptionalSuccessors
in interfaceExceptionBlock
- Returns:
- the list of exceptional successor blocks as an unmodifiable map
-
getSuccessors
public java.util.Set<Block> getSuccessors()
Description copied from interface:Block
Returns the successors of this basic block.- Specified by:
getSuccessors
in interfaceBlock
- Overrides:
getSuccessors
in classSingleSuccessorBlockImpl
- Returns:
- the successors of this basic block
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-