Class ShrikeCFG.BasicBlock

  • All Implemented Interfaces:
    IBasicBlock<com.ibm.wala.shrike.shrikeBT.IInstruction>, com.ibm.wala.util.graph.INodeWithNumber, java.lang.Iterable<com.ibm.wala.shrike.shrikeBT.IInstruction>
    Enclosing class:
    ShrikeCFG

    public final class ShrikeCFG.BasicBlock
    extends com.ibm.wala.util.graph.impl.NodeWithNumber
    implements IBasicBlock<com.ibm.wala.shrike.shrikeBT.IInstruction>
    • Constructor Summary

      Constructors 
      Constructor Description
      BasicBlock​(int startIndex)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      int getFirstInstructionIndex()
      Get the index of the first instruction in the basic block.
      int getLastInstructionIndex()
      Get the index of the last instruction in the basic block.
      IMethod getMethod()  
      int getNumber()
      Each basic block should have a unique number in its cfg
      int hashCode()  
      boolean isCatchBlock()
      Return true if the basic block represents a catch block.
      boolean isEntryBlock()
      Return true if the basic block represents the unique entry block.
      boolean isExitBlock()
      Return true if the basic block represents the unique exit block.
      java.util.Iterator<com.ibm.wala.shrike.shrikeBT.IInstruction> iterator()  
      java.lang.String toString()  
      • Methods inherited from class com.ibm.wala.util.graph.impl.NodeWithNumber

        getGraphNodeId, setGraphNodeId
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface com.ibm.wala.util.graph.INodeWithNumber

        getGraphNodeId, setGraphNodeId
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • BasicBlock

        public BasicBlock​(int startIndex)
    • Method Detail

      • isCatchBlock

        public boolean isCatchBlock()
        Description copied from interface: IBasicBlock
        Return true if the basic block represents a catch block.
        Specified by:
        isCatchBlock in interface IBasicBlock<com.ibm.wala.shrike.shrikeBT.IInstruction>
        Returns:
        true if the basic block represents a catch block.
      • getLastInstructionIndex

        public int getLastInstructionIndex()
        Description copied from interface: IBasicBlock
        Get the index of the last instruction in the basic block. The value is an index into the instruction array that contains all the instructions for the method.

        If the result is < 0, the block has no instructions

        Specified by:
        getLastInstructionIndex in interface IBasicBlock<com.ibm.wala.shrike.shrikeBT.IInstruction>
        Returns:
        the instruction index for the last instruction in the basic block
      • getFirstInstructionIndex

        public int getFirstInstructionIndex()
        Description copied from interface: IBasicBlock
        Get the index of the first instruction in the basic block. The value is an index into the instruction array that contains all the instructions for the method.

        If the result is < 0, the block has no instructions

        Specified by:
        getFirstInstructionIndex in interface IBasicBlock<com.ibm.wala.shrike.shrikeBT.IInstruction>
        Returns:
        the instruction index for the first instruction in the basic block.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • isExitBlock

        public boolean isExitBlock()
        Description copied from interface: IBasicBlock
        Return true if the basic block represents the unique exit block.
        Specified by:
        isExitBlock in interface IBasicBlock<com.ibm.wala.shrike.shrikeBT.IInstruction>
        Returns:
        true if the basic block represents the unique exit block.
      • isEntryBlock

        public boolean isEntryBlock()
        Description copied from interface: IBasicBlock
        Return true if the basic block represents the unique entry block.
        Specified by:
        isEntryBlock in interface IBasicBlock<com.ibm.wala.shrike.shrikeBT.IInstruction>
        Returns:
        true if the basic block represents the unique entry block.
      • getMethod

        public IMethod getMethod()
        Specified by:
        getMethod in interface IBasicBlock<com.ibm.wala.shrike.shrikeBT.IInstruction>
        Returns:
        governing method for this block
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • getNumber

        public int getNumber()
        Description copied from interface: IBasicBlock
        Each basic block should have a unique number in its cfg
        Specified by:
        getNumber in interface IBasicBlock<com.ibm.wala.shrike.shrikeBT.IInstruction>
        Returns:
        the basic block's number
      • iterator

        public java.util.Iterator<com.ibm.wala.shrike.shrikeBT.IInstruction> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<com.ibm.wala.shrike.shrikeBT.IInstruction>