Interface BranchInstruction

All Superinterfaces:
ClassfileElement, CodeElement, Instruction
All Known Implementing Classes:
AbstractInstruction.BoundBranchInstruction, AbstractInstruction.UnboundBranchInstruction

Models a branching instruction (conditional or unconditional) in the code array of a Code attribute. Corresponding opcodes will have a kind of Opcode.Kind.BRANCH. Delivered as a CodeElement when traversing the elements of a CodeModel.
  • Method Details

    • target

      Label target()
      Returns the target of the branch.
      Returns:
      the target of the branch
    • of

      static BranchInstruction of(Opcode op, Label target)
      Returns a branch instruction.
      Parameters:
      op - the opcode for the specific type of branch instruction, which must be of kind Opcode.Kind.BRANCH
      Returns:
      a branch instruction