- All Superinterfaces:
ClassFileElementPREVIEW
,CodeElementPREVIEW
,InstructionPREVIEW
TableSwitchInstruction
is a preview API of the Java platform.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Models a
tableswitch
instruction in the code
array of a
Code
attribute. Delivered as a CodeElement
PREVIEW when traversing
the elements of a CodeModel
PREVIEW.- Since:
- 22
-
Method Summary
Methods declared in interface java.lang.classfile.InstructionPREVIEW
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
-
cases
-
of
static TableSwitchInstructionPREVIEW of(int lowValue, int highValue, LabelPREVIEW defaultTarget, List<SwitchCasePREVIEW> 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
-
TableSwitchInstruction
when preview features are enabled.