org.ow2.asmdex.tree
Class AbstractInsnNode

java.lang.Object
  extended by org.ow2.asmdex.tree.AbstractInsnNode
Direct Known Subclasses:
ArrayLengthInsnNode, ArrayOperationInsnNode, FieldInsnNode, FillArrayDataInsnNode, InsnNode, IntInsnNode, JumpInsnNode, LabelNode, LineNumberNode, LookupSwitchInsnNode, MethodInsnNode, MultiANewArrayInsnNode, OperationInsnNode, StringInsnNode, TableSwitchInsnNode, TypeInsnNode, VarInsnLongNode, VarInsnNode

public abstract class AbstractInsnNode
extends java.lang.Object

A node that represents a bytecode instruction. An instruction can appear at most once in at most one InsnList at a time.

Author:
Eric Bruneton, Julien Névo (constant changes to adapt the class to AsmDex)

Field Summary
static int ARRAY_LENGTH_INSN
          The type of ArrayLengthInsnNode "instructions".
static int ARRAY_OPERATION_INSN
          The type of ArrayOperationInsnNode "instructions".
static int FIELD_INSN
          The type of FieldInsnNode instructions.
static int FILL_ARRAY_DATA_INSN
          The type of FillArrayDataInsnNode "instructions".
static int INSN
          The type of InsnNode instructions.
static int INT_INSN
          The type of IntInsnNode instructions.
static int JUMP_INSN
          The type of JumpInsnNode instructions.
static int LABEL_INSN
          The type of LabelNode "instructions".
static int LINE
          The type of LineNumberNode "instructions".
static int LOOKUPSWITCH_INSN
          The type of LookupSwitchInsnNode instructions.
static int METHOD_INSN
          The type of MethodInsnNode instructions.
static int MULTIANEWARRAY_INSN
          The type of MultiANewArrayInsnNode instructions.
protected  int opcode
          The opcode of this instruction.
static int OPERATION_INSN
          The type of OperationInsnNode instructions.
static int STRING_INSN
          The type of StringInsnNode instructions.
static int TABLESWITCH_INSN
          The type of TableSwitchInsnNode instructions.
static int TYPE_INSN
          The type of TypeInsnNode instructions.
static int VAR_INSN
          The type of VarInsnNode instructions.
static int VAR_INSN_LONG
          The type of VarInsnLongNode instructions.
 
Constructor Summary
protected AbstractInsnNode(int opcode)
          Constructs a new AbstractInsnNode.
 
Method Summary
abstract  void accept(MethodVisitor mv)
          Makes the given code visitor visit this instruction.
abstract  AbstractInsnNode clone(java.util.Map<LabelNode,LabelNode> labels)
          Returns a copy of this instruction.
 AbstractInsnNode getNext()
          Returns the next instruction in the list to which this instruction belongs, if any.
 int getOpcode()
          Returns the opcode of this instruction.
 AbstractInsnNode getPrevious()
          Returns the previous instruction in the list to which this instruction belongs, if any.
abstract  int getType()
          Returns the type of this instruction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSN

public static final int INSN
The type of InsnNode instructions.

See Also:
Constant Field Values

INT_INSN

public static final int INT_INSN
The type of IntInsnNode instructions.

See Also:
Constant Field Values

VAR_INSN

public static final int VAR_INSN
The type of VarInsnNode instructions.

See Also:
Constant Field Values

VAR_INSN_LONG

public static final int VAR_INSN_LONG
The type of VarInsnLongNode instructions.

See Also:
Constant Field Values

TYPE_INSN

public static final int TYPE_INSN
The type of TypeInsnNode instructions.

See Also:
Constant Field Values

FIELD_INSN

public static final int FIELD_INSN
The type of FieldInsnNode instructions.

See Also:
Constant Field Values

METHOD_INSN

public static final int METHOD_INSN
The type of MethodInsnNode instructions.

See Also:
Constant Field Values

JUMP_INSN

public static final int JUMP_INSN
The type of JumpInsnNode instructions.

See Also:
Constant Field Values

LABEL_INSN

public static final int LABEL_INSN
The type of LabelNode "instructions".

See Also:
Constant Field Values

STRING_INSN

public static final int STRING_INSN
The type of StringInsnNode instructions.

See Also:
Constant Field Values

OPERATION_INSN

public static final int OPERATION_INSN
The type of OperationInsnNode instructions.

See Also:
Constant Field Values

TABLESWITCH_INSN

public static final int TABLESWITCH_INSN
The type of TableSwitchInsnNode instructions.

See Also:
Constant Field Values

LOOKUPSWITCH_INSN

public static final int LOOKUPSWITCH_INSN
The type of LookupSwitchInsnNode instructions.

See Also:
Constant Field Values

MULTIANEWARRAY_INSN

public static final int MULTIANEWARRAY_INSN
The type of MultiANewArrayInsnNode instructions.

See Also:
Constant Field Values

ARRAY_LENGTH_INSN

public static final int ARRAY_LENGTH_INSN
The type of ArrayLengthInsnNode "instructions".

See Also:
Constant Field Values

ARRAY_OPERATION_INSN

public static final int ARRAY_OPERATION_INSN
The type of ArrayOperationInsnNode "instructions".

See Also:
Constant Field Values

FILL_ARRAY_DATA_INSN

public static final int FILL_ARRAY_DATA_INSN
The type of FillArrayDataInsnNode "instructions".

See Also:
Constant Field Values

LINE

public static final int LINE
The type of LineNumberNode "instructions".

See Also:
Constant Field Values

opcode

protected int opcode
The opcode of this instruction.

Constructor Detail

AbstractInsnNode

protected AbstractInsnNode(int opcode)
Constructs a new AbstractInsnNode.

Parameters:
opcode - the opcode of the instruction to be constructed.
Method Detail

getOpcode

public int getOpcode()
Returns the opcode of this instruction.

Returns:
the opcode of this instruction.

getType

public abstract int getType()
Returns the type of this instruction.

Returns:
the type of this instruction, i.e. one the constants defined in this class.

getPrevious

public AbstractInsnNode getPrevious()
Returns the previous instruction in the list to which this instruction belongs, if any.

Returns:
the previous instruction in the list to which this instruction belongs, if any. May be null.

getNext

public AbstractInsnNode getNext()
Returns the next instruction in the list to which this instruction belongs, if any.

Returns:
the next instruction in the list to which this instruction belongs, if any. May be null.

accept

public abstract void accept(MethodVisitor mv)
Makes the given code visitor visit this instruction.

Parameters:
mv - a code visitor.

clone

public abstract AbstractInsnNode clone(java.util.Map<LabelNode,LabelNode> labels)
Returns a copy of this instruction.

Parameters:
labels - a map from LabelNodes to cloned LabelNodes.
Returns:
a copy of this instruction. The returned instruction does not belong to any InsnList.