All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class de.fub.bytecode.generic.CPInstruction

java.lang.Object
   |
   +----de.fub.bytecode.generic.Instruction
           |
           +----de.fub.bytecode.generic.CPInstruction

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

Version:
$Id: CPInstruction.java,v 1.7 1999/07/09 15:55:07 dahm Exp $
Author:
M. Dahm
See Also:
ConstantPoolGen, LDC, INVOKEVIRTUAL

Variable Index

 o index

Constructor Index

 o CPInstruction(short, int)

Method Index

 o dump(DataOutputStream)
Dump instruction as byte code to stream out.
 o getIndex()
 o getType(ConstantPoolGen)
 o initFromFile(ByteSequence, boolean)
Read needed data (i.e.
 o setIndex(int)
Set the index to constant pool.
 o toString(boolean)
Long output format: <name of opcode> "["<opcode number>"]" "("<length of instruction>")" "<"< constant pool index>">"
 o toString(ConstantPool)

Variables

 o index
 protected int index

Constructors

 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(boolean verbose)
Long output format: <name of opcode> "["<opcode number>"]" "("<length of instruction>")" "<"< constant pool index>">"

Parameters:
verbose - long/short format switch
Returns:
mnemonic for instruction
Overrides:
toString in class Instruction
 o toString
 public String toString(ConstantPool cp)
Returns:
mnemonic for instruction with symbolic references resolved
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 void setIndex(int index)
Set the index to constant pool.

 o getType
 public Type getType(ConstantPoolGen cpg)
Returns:
type related with this instruction.

All Packages  Class Hierarchy  This Package  Previous  Next  Index