java.lang.Object
com.chaoswg.xtc4y.classdesc.code.instructions.Instruction
- Direct Known Subclasses:
- BinaryInstruction, InvokeInterface, LookupSwitchInstruction, MultiANewArray, TableSwitchInstruction, TrinaryInstruction, UnaryInstruction, WideBinaryInstruction
- public abstract class Instruction
- extends java.lang.Object
An instruction is a operation executed in java and consists either of
no operand or one operand. The size of the operand my vary between a byte
and a short. These specific instructions are implemented in the subclasses
|
Constructor Summary |
protected |
Instruction(byte command)
Creates a Instruction for a specific command |
command
private byte command
index
private short index
Instruction
protected Instruction(byte command)
- Creates a Instruction for a specific command
write
public void write(java.io.DataOutputStream dos,
com.chaoswg.xtc4y.classdesc.ConstantPool cp)
throws java.io.IOException
- Write the instruction onto the DataOutputStream, using the
constant pool to register variables. .
resolveIndices
public void resolveIndices(com.chaoswg.xtc4y.classdesc.code.Code code)
- Resolve indices of instructions.
By default do nothing
getNumberOfUsedBytes
public abstract int getNumberOfUsedBytes()
setIndex
public void setIndex(short index)
- Set the index of this instruction, is set by the code container
getIndex
public short getIndex()
toString
public java.lang.String toString()
- Write code in a readable way
getOpcode
public byte getOpcode()
getCommand
public byte getCommand()