tableswitch instruction in the code array of a
Code attribute. Delivered as a CodeElement when traversing
the elements of a CodeModel.
A table switch instruction is composite:
TableSwitchInstruction( int lowValue, int highValue, Label defaultTarget, List<SwitchCase> cases )
When read from class files, the cases may omit cases that
duplicate the default target. The list is sorted ascending by the caseValue.
When writing to class file, the order in the cases list does
not matter, as there is only one valid order in the physical representation
of table switch entries. Treatment of elements in cases whose value
is less than lowValue or greater than highValue, and elements
whose value duplicates that of another, is not specified.
Opcode.Kind#TABLE_SWITCH , CodeBuilder::tableswitch
| Modifier and Type | Method and Description |
|---|---|
| public List | |
| public Label | |
| public int | Returns: the high value of the switch target range, inclusiveReturns the high value of the switch target range, inclusive. |
| public int | Returns: the low value of the switch target range, inclusiveReturns the low value of the switch target range, inclusive. |
| public static TableSwitchInstruction | Returns: a table switch instructionthe low value of the switch target range, inclusive lowValue, int the high value of the switch target range, inclusive highValue, Label the default target of the switch defaultTarget, List<SwitchCase> the cases of the switch; duplicate or out of bound case
handling is not specified cases)Returns a table switch instruction. |
| cases | back to summary |
|---|---|
| public List Returns the cases of the switch.
| |
| defaultTarget | back to summary |
|---|---|
| public Label defaultTarget() Returns the default target of the switch.
| |
| highValue | back to summary |
|---|---|
| public int highValue() Returns the high value of the switch target range, inclusive.
| |
| lowValue | back to summary |
|---|---|
| public int lowValue() Returns the low value of the switch target range, inclusive.
| |
| of | back to summary |
|---|---|
| public static TableSwitchInstruction of(int lowValue, int highValue, Label defaultTarget, List<SwitchCase> cases) Returns a table switch instruction.
| |