public abstract class AbstractInstruction extends Object
Modifier | Constructor and Description |
---|---|
protected |
AbstractInstruction(Opcode opcode)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getOffset()
Get the offset of this instruction in its parent Code attribute.
|
Opcode |
getOpcode()
Get the opcode of this instruction.
|
int |
getSize()
Get the size in bytes of this instruction.
|
void |
read(ByteCodeInput in)
Read this instruction from the given ByteCodeInput.
|
void |
setOffset(int offset)
Set the offset of this instruction in its parent Code attribute.
|
void |
setOpcode(Opcode opcode)
Set the opcode of this instruction.
|
void |
write(ByteCodeOutput out)
Write this instruction to the given ByteCodeOutput.
|
protected AbstractInstruction(Opcode opcode)
opcode
- the opcode.public int getSize()
public Opcode getOpcode()
public void setOpcode(Opcode opcode)
opcode
- the opcodepublic int getOffset()
public void setOffset(int offset)
offset
- the offsetpublic void read(ByteCodeInput in) throws IOException
Expects ByteCodeInput to be in JVM class file format and just before a instruction of this kind.
in
- the ByteCodeInput from which to readIOException
- if an exception occurs with the ByteCodeInputpublic void write(ByteCodeOutput out) throws IOException
out
- the ByteCodeOutput to which to writeIOException
- if an exception occurs with the ByteCodeOutput