- All Superinterfaces:
ClassFileElement,CodeElement,Instruction
- All Known Implementing Classes:
AbstractInstruction.BoundTableSwitchInstruction,AbstractInstruction.UnboundTableSwitchInstruction
public sealed interface TableSwitchInstruction
extends Instruction
permits 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 Summary
Modifier and TypeMethodDescriptioncases()Returns the cases of the switch.Returns the default target of the switch.intReturns the high value of the switch target range, inclusive.intlowValue()Returns the low value of the switch target range, inclusive.static TableSwitchInstructionof(int lowValue, int highValue, Label defaultTarget, List<SwitchCase> cases) Returns a table switch instruction.Methods inherited from interface org.glavo.classfile.Instruction
opcode, sizeInBytes
-
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, inclusivehighValue- the high value of the switch target range, inclusivedefaultTarget- the default target of the switchcases- the cases of the switch- Returns:
- a table switch instruction
-