joeq.Compiler.BytecodeAnalysis
Class Bytecodes.InstructionHandle

java.lang.Object
  extended by joeq.Compiler.BytecodeAnalysis.Bytecodes.InstructionHandle
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Bytecodes.BranchHandle
Enclosing interface:
Bytecodes

public static class Bytecodes.InstructionHandle
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Method Summary
 void accept(Bytecodes.Visitor v)
          Convenience method, simply calls accept() on the contained instruction.
 void addAttribute(java.lang.Object key, java.lang.Object attr)
          Add an attribute to an instruction handle.
 void addTargeter(Bytecodes.InstructionTargeter t)
          Denote this handle is being referenced by t.
 java.lang.Object getAttribute(java.lang.Object key)
          Get attribute of an instruction handle.
 Bytecodes.Instruction getInstruction()
           
 Bytecodes.InstructionHandle getNext()
           
 int getPosition()
           
 Bytecodes.InstructionHandle getPrev()
           
 java.util.Set getTargeters()
           
 boolean hasTargeters()
           
 void removeAllTargeters()
          Remove all targeters, if any.
 void removeAttribute(java.lang.Object key)
          Delete an attribute of an instruction handle.
 void removeTargeter(Bytecodes.InstructionTargeter t)
          Denote this handle isn't referenced anymore by t.
 void setInstruction(Bytecodes.Instruction i)
          Replace current instruction contained in this handle.
 Bytecodes.Instruction swapInstruction(Bytecodes.Instruction i)
          Temporarily swap the current instruction, without disturbing anything.
 java.lang.String toString()
           
 java.lang.String toString(boolean verbose)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getNext

public final Bytecodes.InstructionHandle getNext()

getPrev

public final Bytecodes.InstructionHandle getPrev()

getInstruction

public final Bytecodes.Instruction getInstruction()

setInstruction

public void setInstruction(Bytecodes.Instruction i)
Replace current instruction contained in this handle. Old instruction is disposed using Instruction.dispose().


swapInstruction

public Bytecodes.Instruction swapInstruction(Bytecodes.Instruction i)
Temporarily swap the current instruction, without disturbing anything. Meant to be used by a debugger, implementing breakpoints. Current instruction is returned.


getPosition

public int getPosition()
Returns:
the position, i.e., the byte code offset of the contained instruction. This is accurate only after InstructionList.setPositions() has been called.

removeAllTargeters

public void removeAllTargeters()
Remove all targeters, if any.


removeTargeter

public void removeTargeter(Bytecodes.InstructionTargeter t)
Denote this handle isn't referenced anymore by t.


addTargeter

public void addTargeter(Bytecodes.InstructionTargeter t)
Denote this handle is being referenced by t.


hasTargeters

public boolean hasTargeters()

getTargeters

public java.util.Set getTargeters()
Returns:
null, if there are no targeters

toString

public java.lang.String toString(boolean verbose)
Returns:
a (verbose) string representation of the contained instruction.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
a string representation of the contained instruction.

addAttribute

public void addAttribute(java.lang.Object key,
                         java.lang.Object attr)
Add an attribute to an instruction handle.

Parameters:
key - the key object to store/retrieve the attribute
attr - the attribute to associate with this handle

removeAttribute

public void removeAttribute(java.lang.Object key)
Delete an attribute of an instruction handle.

Parameters:
key - the key object to retrieve the attribute

getAttribute

public java.lang.Object getAttribute(java.lang.Object key)
Get attribute of an instruction handle.

Parameters:
key - the key object to store/retrieve the attribute

accept

public void accept(Bytecodes.Visitor v)
Convenience method, simply calls accept() on the contained instruction.

Parameters:
v - Visitor object