Interface TableSwitchInstruction

All Superinterfaces:
ClassFileElement, CodeElement, Instruction
All Known Implementing Classes:
AbstractInstruction.BoundTableSwitchInstruction, AbstractInstruction.UnboundTableSwitchInstruction

Models a tableswitch instruction in the code array of a Code attribute. Delivered as a CodeElement when traversing the elements of a CodeModel.
Since:
22
  • Method Details

    • lowValue

      int lowValue()
      Returns the low value of the switch target range, inclusive.
      Returns:
      the low value of the switch target range, inclusive
    • highValue

      int highValue()
      Returns the high value of the switch target range, inclusive.
      Returns:
      the high value of the switch target range, inclusive
    • defaultTarget

      Label defaultTarget()
      Returns the default target of the switch.
      Returns:
      the default target of the switch
    • cases

      List<SwitchCase> cases()
      Returns the cases of the switch.
      Returns:
      the cases of the switch
    • of

      static TableSwitchInstruction of(int lowValue, int highValue, Label defaultTarget, List<SwitchCase> cases)
      Returns a table switch instruction.
      Parameters:
      lowValue - the low value of the switch target range, inclusive
      highValue - the high value of the switch target range, inclusive
      defaultTarget - the default target of the switch
      cases - the cases of the switch
      Returns:
      a table switch instruction