All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class espresso.classfile.classgen.CPInstruction

java.lang.Object
   |
   +----espresso.classfile.classgen.Instruction
           |
           +----espresso.classfile.classgen.CPInstruction

public abstract class CPInstruction
extends Instruction
Abstract super class for instructions that use an index into the constant pool such as LDC, INVOKEVIRTUAL, etc.

See Also:
ConstantPoolGen, LDC, INVOKEVIRTUAL

Variable Index

 o index

Constructor Index

 o CPInstruction()
Empty constructor needed for the Class.newInstance() statement in Instruction.readInstruction().
 o CPInstruction(short, int)

Method Index

 o dump(DataOutputStream)
Dump instruction as byte code to stream out.
 o getIndex()
 o initFromFile(ByteSequence, boolean)
Read needed data (i.e.
 o setIndex(int)
Set the index to constant pool.
 o toString()

Variables

 o index
 protected int index

Constructors

 o CPInstruction
 CPInstruction()
Empty constructor needed for the Class.newInstance() statement in Instruction.readInstruction(). Not to be used otherwise.

 o CPInstruction
 protected CPInstruction(short tag,
                         int index)
Parameters:
index - to constant pool

Methods

 o dump
 public void dump(DataOutputStream out) throws IOException
Dump instruction as byte code to stream out.

Parameters:
out - Output stream
Overrides:
dump in class Instruction
 o toString
 public String toString()
Returns:
mnemonic for instruction
Overrides:
toString in class Instruction
 o initFromFile
 protected void initFromFile(ByteSequence bytes,
                             boolean wide) throws IOException
Read needed data (i.e. index) from file.

Overrides:
initFromFile in class Instruction
 o getIndex
 public final int getIndex()
Returns:
index in constant pool referred by this instruction.
 o setIndex
 public final void setIndex(int index)
Set the index to constant pool.


All Packages  Class Hierarchy  This Package  Previous  Next  Index