|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rit.classfile.Instruction
public abstract class Instruction
Class Instruction encapsulates a Java bytecode instruction. To create a
particular instruction, use the desired static field or method in class
Op
. For example:
SynthesizedMethodDescription theMethod = . . .; ClassReference javaLangObject = NamedClassReference.JAVA_LANG_OBJECT; SubroutineReference javaLangObjectInit = new ConstructorReference (javaLangObject); . . . theMethod.addInstruction (Op.ALOAD (0)); theMethod.addInstruction (Op.INVOKESPECIAL (javaLangObjectInit)); theMethod.addInstruction (Op.RETURN);
Method Summary | |
---|---|
abstract byte[] |
getByteCodes()
Returns a copy of this instruction's bytecodes. |
abstract int |
getLength()
Returns this 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 abstract int getLength()
public abstract byte[] getByteCodes() throws ByteCodeException
ByteCodeException
- Thrown if there was a problem generating this 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 |