|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rit.classfile.Instruction
edu.rit.classfile.SwitchInstruction
public abstract class SwitchInstruction
Class SwitchInstruction is the abstract superclass for all switch instructions. To add a switch instruction to a subroutine (method, constructor, or class initializer):
Op.LOOKUPSWITCH()
or
Op.TABLESWITCH()
method to
manufacture a switch instruction of the desired kind, specifying the target
branch location for the default case.
addCase()
method.
Method Summary | |
---|---|
void |
addCase(int theCaseValue,
Location theTarget)
Add a (case value, target branch location) pair to this switch instruction. |
byte[] |
getByteCodes()
Returns a copy of this switch instruction's bytecodes. |
int |
getLength()
Returns this switch instruction's length, i.e., number of bytes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void addCase(int theCaseValue, Location theTarget)
theCaseValue
- Case value.theTarget
- Target branch location.
NullPointerException
- (unchecked exception) Thrown if theTarget is null.
IllegalStateException
- (unchecked exception) Thrown if no further cases can be added because
this switch instruction has already been added to a subroutine.public int getLength()
getLength
in class Instruction
public byte[] getByteCodes() throws ByteCodeException
getByteCodes
in class Instruction
ByteCodeException
- Thrown if there was a problem generating this switch instruction's
bytecodes. The exception's detail message describes the problem.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |