jellyj.classfile.classgen
Class CPInstruction

jellyj.classfile.classgen.Instruction
  |
  +--jellyj.classfile.classgen.CPInstruction
Direct Known Subclasses:
ANEWARRAY, CHECKCAST, GETFIELD, GETSTATIC, INSTANCEOF, INVOKEINTERFACE, INVOKESPECIAL, INVOKESTATIC, INVOKEVIRTUAL, LDC, LDC_W, LDC2_W, MULTIANEWARRAY, NEW, PUTFIELD, PUTSTATIC

public abstract class CPInstruction
extends Instruction

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

Author:
JellyJ Design Group
See Also: ConstantPoolGen, LDC, INVOKEVIRTUAL

Constructor Summary
 (package private) CPInstruction()
          Empty constructor needed for the Class.newInstance() statement in Instruction.readInstruction().

Method Summary
 voiddump(DataOutputStream out)
          Dump instruction as byte code to stream out.
 final intgetIndex()
           
 final voidsetIndex(int index)
          Set the index to constant pool.
 StringtoString()
           

Methods inherited from class jellyj.classfile.classgen.Instruction
consumeStack, copy, getLength, getPosition, getTag, produceStack, readInstruction, setPosition

Constructor Detail

CPInstruction

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

dump

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

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.

toString

public String toString()
Returns: mnemonic for instruction