|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.rej.java.instruction.Instruction net.sf.rej.java.instruction.Label
public class Label
The concept "label" does not exist in the java bytecode. Instead it's created in the ReJ API to help the user of the API to avoid having to manipulate relative pc position values, whenever an instruction is added or removed between for example between a goto instruction and it's target. The positition would have to be recalculated every time and with non-fixed size instructions the task would not be trivial. Logically a Label is not an instruction, but since it shares a lot of functionality with instructions, making the class extend Instruction was a practical (lazy) choice.
Constructor Summary | |
---|---|
Label(int pos)
|
|
Label(int pos,
java.lang.String id)
|
Method Summary | |
---|---|
void |
execute(ExecutionContext ec)
Reserved for possible future use. |
byte[] |
getData(DecompilationContext dc)
Get the bytecode data for this instruction. |
java.lang.String |
getId()
|
java.lang.String |
getMnemonic()
Return the mnemonic of this instruction. |
int |
getOpcode()
Return the Opcode of this instruction. |
Parameters |
getParameters()
Return a Parameters object describing the types of parameters(if any) and the values set to this particular instance for those parameters. |
Parameters |
getParameterTypes()
Return a Parameters object describing the types of parameters(if any) that are applicable to this type of an instruction. |
int |
getPosition()
|
int |
getSize()
Return the size of this instruction. |
void |
setData(byte[] data,
DecompilationContext dc)
Set the data for this instruction. |
void |
setParameters(Parameters params)
Update the parameter values of this instruction with the values in the Parameters object defined by params. |
void |
setPosition(int pos)
|
java.lang.String |
toString()
Returns a textual description of this instruction instance. |
Methods inherited from class net.sf.rej.java.instruction.Instruction |
---|
createNewInstance, getLabels, getPoppedElements, getPushedElements, getSize |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Label(int pos)
public Label(int pos, java.lang.String id)
Method Detail |
---|
public void setPosition(int pos)
public int getSize()
Instruction
getSize
in class Instruction
public int getOpcode()
Instruction
getOpcode
in class Instruction
public java.lang.String getMnemonic()
Instruction
getMnemonic
in class Instruction
public void execute(ExecutionContext ec)
Instruction
execute
in class Instruction
ec
- Context for execution.public int getPosition()
public java.lang.String getId()
public java.lang.String toString()
Instruction
toString
in class Instruction
public void setData(byte[] data, DecompilationContext dc)
Instruction
setData
in class Instruction
data
- A byte arrray with the instruction data, starting with the
opcode byte(s) and followed by any parameters if applicable.dc
- A callback mechanism to offer the instruction information
about the context where it's located.public byte[] getData(DecompilationContext dc)
Instruction
getData
in class Instruction
dc
- A callback mechanism to offer the instruction information
about the context where it's located.
public Parameters getParameterTypes()
Instruction
getParameterTypes
in class Instruction
Parameters
object with the types of parameters
applicable for this type of an instruction.public Parameters getParameters()
Instruction
getParameters
in class Instruction
Parameters
object with the types and current
values of the parameters.public void setParameters(Parameters params)
Instruction
setParameters
in class Instruction
params
- A Parameters
object with new values for this
instruction.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |