Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class DE.fub.inf.JVM.ClassGen.CPInstruction

java.lang.Object
  |
  +--DE.fub.inf.JVM.ClassGen.Instruction
        |
        +--DE.fub.inf.JVM.ClassGen.CPInstruction
Subclasses:
ANEWARRAY, CHECKCAST, FieldInstruction, INSTANCEOF, InvokeInstruction, LDC_W, LDC2_W, LDC, MULTIANEWARRAY, NEW

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

Version:
$Id: CPInstruction.java,v 1.2 1998/08/14 16:56:10 dahm Exp $
Author:
M. Dahm
See Also:
ConstantPoolGen, LDC, INVOKEVIRTUAL, Serialized Form

Field Summary
int index
           
 
Fields inherited from class DE.fub.inf.JVM.ClassGen.Instruction
length, position, tag
 
Constructor Summary
CPInstruction(short tag, int index)
           
 
Method Summary
void dump(java.io.DataOutputStream out)
          Dump instruction as byte code to stream out.
int getIndex()
           
void initFromFile(ByteSequence bytes, boolean wide)
          Read needed data (i.e. index) from file.
void setIndex(int index)
          Set the index to constant pool.
java.lang.String toString(boolean verbose)
          Long output format: <position in byte code> <name of opcode> "["<opcode number>"]" "("<length of instruction>")" "<"< constant pool index>">"
java.lang.String toString(ConstantPool cp)
           
 
Methods inherited from class DE.fub.inf.JVM.ClassGen.Instruction
consumeStack, dump, getInstructionList, getLength, getPosition, getTag, initFromFile, produceStack, readInstruction, setPosition, toString, toString, toString, updatePosition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Field Detail

index

protected int index
Constructor Detail

CPInstruction

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

dump

public void dump(java.io.DataOutputStream out)
         throws java.io.IOException
Dump instruction as byte code to stream out.
Parameters:
out - Output stream
Overrides:
dump in class Instruction

toString

public java.lang.String toString(boolean verbose)
Long output format: <position in byte code> <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

toString

public java.lang.String toString(ConstantPool cp)
Returns:
mnemonic for instruction with sumbolic references resolved
Overrides:
toString in class Instruction

initFromFile

protected void initFromFile(ByteSequence bytes,
                            boolean wide)
                    throws java.io.IOException
Read needed data (i.e. index) from file.
Overrides:
initFromFile in class Instruction

getIndex

public final int getIndex()
Returns:
index in constant pool referred by this instruction.

setIndex

public final void setIndex(int index)
Set the index to constant pool.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD