public abstract class BytecodeSwitch extends Object
Bytecodes.LOOKUPSWITCH
and Bytecodes.TABLESWITCH instructions.| Modifier and Type | Field and Description |
|---|---|
protected int |
alignedBci
Index of the start of the additional data for the switch instruction, aligned to a multiple
of four from the method start.
|
protected int |
bci
Index of start of switch instruction.
|
protected BytecodeStream |
stream
The
BytecodeStream containing the bytecode array. |
| Constructor and Description |
|---|
BytecodeSwitch(BytecodeStream stream,
int bci)
Constructor for a
BytecodeStream. |
| Modifier and Type | Method and Description |
|---|---|
int |
bci()
Gets the current bytecode index.
|
int |
defaultOffset()
Gets the offset from the start of the switch instruction to the default switch target.
|
int |
defaultTarget()
Gets the index of the instruction for the default switch target.
|
abstract int |
keyAt(int i)
Gets the key at
i'th switch target index. |
abstract int |
numberOfCases()
Gets the number of switch targets.
|
abstract int |
offsetAt(int i)
Gets the offset from the start of the switch instruction for the
i'th switch target. |
abstract int |
size()
Gets the total size in bytes of the switch instruction.
|
int |
targetAt(int i)
Gets the index of the instruction denoted by the
i'th switch target. |
protected final BytecodeStream stream
BytecodeStream containing the bytecode array.protected final int bci
protected final int alignedBci
public BytecodeSwitch(BytecodeStream stream, int bci)
BytecodeStream.stream - the BytecodeStream containing the switch instructionbci - the index in the stream of the switch instructionpublic int bci()
public int targetAt(int i)
i'th switch target.i - index of the switch targeti'th switch targetpublic int defaultTarget()
public int defaultOffset()
public abstract int keyAt(int i)
i'th switch target index.i - the switch target indexi'th switch target indexpublic abstract int offsetAt(int i)
i'th switch target.i - the switch target indexi'th switch targetpublic abstract int numberOfCases()
public abstract int size()