|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjef.dna.instructions.impl.InstructionAncestor
public abstract class InstructionAncestor
This class is the ancestor of all the concrete instruction classes, and provides all these methods common to every instruction.
Field Summary | |
---|---|
protected static Logger |
logger
|
protected int |
opCode
|
protected int[] |
operands
|
protected int |
operandsCount
|
Constructor Summary | |
---|---|
InstructionAncestor()
|
Method Summary | |
---|---|
java.lang.Object |
clone()
Performs the cloning of the current Instruction implementation. |
int |
fromArray(int[] bytecode,
int startFrom)
This method populates all the attributes of an Instruction implementation |
int |
getBytesCount()
This method must return the overall number of bytes required by the component implementing this interface. |
int |
getOpCode()
This method returns the instruction's numeric operation code as a byte . |
int[] |
getOperands()
This method returns the current operation operand stack. |
int |
getOperandsCount()
This method returns the number of operands required by the bytecode instruction. |
void |
setOpCode(int opCode)
This method sets the current operation code to the specified byte. |
void |
setOperands(int[] operands)
This method sets the current operation's operand stack. |
void |
setOperandsCountPosticipated(int[] bytecode,
int startFrom)
This method should be implemented by those classes wrapping JVM instructions whose number of operands is variable. |
int[] |
toArray()
This method returns the method's bytecode as an array. |
int |
updateRefs(int offset)
This method must implement the logic necessary to update all the references to constant pool table's entries contained within the bytecode instruction. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final Logger logger
protected int opCode
protected int[] operands
protected int operandsCount
Constructor Detail |
---|
public InstructionAncestor()
Method Detail |
---|
public int fromArray(int[] bytecode, int startFrom)
Instruction
implementation
fromArray
in interface Instruction
bytecode
- The bytecode arraystartFrom
- The index of the current instruction's mnemonic (opcode)
public void setOperandsCountPosticipated(int[] bytecode, int startFrom)
fromArray
method defined in
the InstructionAncestor
class. InstructionAncestor
already
contains an empty implementation of this method, useful for those classes exposing a prefixed
number of operands. In such a case there is no need to override the
setOperandsCountPosticipated
method
setOperandsCountPosticipated
in interface Instruction
bytecode
- The method's bytecodestartFrom
- The index of the current instruction's mnemonic (opcode)public int[] toArray()
toArray
in interface Instruction
public int getOpCode()
byte
.
getOpCode
in interface Instruction
public void setOpCode(int opCode)
setOpCode
in interface Instruction
opCode
- The byte
representation of the operation code.public int[] getOperands()
getOperands
in interface Instruction
public void setOperands(int[] operands)
setOperands
in interface Instruction
operands
- The operand stack as a byte
array.public int updateRefs(int offset)
updateRefs
in interface Instruction
offset
- The offset used for updating expressed as number of cpt's entries to be skipped
public int getOperandsCount()
setOperands
method with the right number
of bytes as input parametr.
getOperandsCount
in interface Instruction
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Instruction
Instruction
implementation.
clone
in interface Instruction
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public int getBytesCount()
BytesCountable
getBytesCount
in interface BytesCountable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |