Interface TableSwitchInstruction
- All Superinterfaces:
ClassFileElement
,CodeElement
,Instruction
Models a
tableswitch
instruction in the code
array of a
Code
attribute. Delivered as a CodeElement
when traversing
the elements of a CodeModel
.- Since:
- 24
-
Method Summary
Modifier and TypeMethodDescriptioncases()
Returns the cases of the switch.Returns the default target of the switch.int
Returns the high value of the switch target range, inclusive.int
lowValue()
Returns the low value of the switch target range, inclusive.static TableSwitchInstruction
of
(int lowValue, int highValue, Label defaultTarget, List<SwitchCase> cases) Returns a table switch instruction.Methods declared in interface java.lang.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
-
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
-