org.apache.bcel.generic
public class InstructionHandle extends Object implements Serializable
Version: $Id: InstructionHandle.java 386056 2006-03-15 11:31:56Z tcurdt $
See Also: Instruction BranchHandle InstructionList
| Field Summary | |
|---|---|
| Map | attributes |
| static InstructionHandle | ih_list |
| Instruction | instruction |
| protected int | i_position |
| InstructionHandle | next |
| InstructionHandle | prev |
| Set | targeters |
| Constructor Summary | |
|---|---|
| protected | InstructionHandle(Instruction i) |
| Method Summary | |
|---|---|
| void | accept(Visitor v) Convenience method, simply calls accept() on the contained instruction.
|
| void | addAttribute(Object key, Object attr) Add an attribute to an instruction handle.
|
| protected void | addHandle() Overridden in BranchHandle |
| void | addTargeter(InstructionTargeter t)
Denote this handle is being referenced by t. |
| void | dispose()
Delete contents, i.e., remove user access and make handle reusable. |
| Object | getAttribute(Object key) Get attribute of an instruction handle.
|
| Collection | getAttributes() |
| Instruction | getInstruction() |
| static InstructionHandle | getInstructionHandle(Instruction i) Factory method. |
| InstructionHandle | getNext() |
| int | getPosition() |
| InstructionHandle | getPrev() |
| InstructionTargeter[] | getTargeters() |
| boolean | hasTargeters() |
| void | removeAllTargeters() Remove all targeters, if any. |
| void | removeAttribute(Object key) Delete an attribute of an instruction handle.
|
| void | removeTargeter(InstructionTargeter t)
Denote this handle isn't referenced anymore by t. |
| void | setInstruction(Instruction i)
Replace current instruction contained in this handle.
|
| void | setPosition(int pos) Set the position, i.e., the byte code offset of the contained
instruction. |
| Instruction | swapInstruction(Instruction i)
Temporarily swap the current instruction, without disturbing
anything. |
| String | toString(boolean verbose) |
| String | toString() |
| protected int | updatePosition(int offset, int max_offset)
Called by InstructionList.setPositions when setting the position for every
instruction. |
Parameters: v Visitor object
Parameters: key the key object to store/retrieve the attribute attr the attribute to associate with this handle
Parameters: key the key object to store/retrieve the attribute
Returns: all attributes associated with this handle
Returns: the position, i.e., the byte code offset of the contained instruction. This is accurate only after InstructionList.setPositions() has been called.
Returns: null, if there are no targeters
Parameters: key the key object to retrieve the attribute
Returns: a (verbose) string representation of the contained instruction.
Returns: a string representation of the contained instruction.
Parameters: offset additional offset caused by preceding (variable length) instructions max_offset the maximum offset that may be caused by these instructions
Returns: additional offset caused by possible change of this instruction's length