Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.chaoswg.xtc4y.classdesc.code.instructions
Class CPRefInstruction  view CPRefInstruction download CPRefInstruction.java

java.lang.Object
  extended bycom.chaoswg.xtc4y.classdesc.code.instructions.Instruction
      extended bycom.chaoswg.xtc4y.classdesc.code.instructions.WideBinaryInstruction
          extended bycom.chaoswg.xtc4y.classdesc.code.instructions.CPRefInstruction
Direct Known Subclasses:
ANewArray, CheckCast, ClassInstruction, FieldrefInstruction, InstanceOf, InvokeSpecial, InvokeStatic, InvokeVirtual, LDC_W, LDC2_W, MethodrefInstruction, New

public class CPRefInstruction
extends WideBinaryInstruction

a constant pool refernece instruction is an instruction composite of the command and a short refering into the cp table.


Field Summary
static byte ANEWARRAY
          instantiation of an array
static byte CHECKCAST
          check a cast
private  com.chaoswg.xtc4y.classdesc.ConstantPoolEntry cpEntry
           
static byte GETFIELD
          get an instance field value
static byte GETSTATIC
          get a static field value
static byte INSTANCEOF
          check the object instance
static byte INVOKESPECIAL
          invoke the instance initialisation method
static byte INVOKESTATIC
          invoke a static method
static byte INVOKEVIRTUAL
          invoke a method on an object
static byte LDC_W
          load an int, byte, short, float, string, char from the cp
static byte LDC2_W
          load a float or double from the cp
static byte NEW
          instantiate a new object
static byte PUTFIELD
          put an instance field value
static byte PUTSTATIC
          gput a static field value
 
Fields inherited from class com.chaoswg.xtc4y.classdesc.code.instructions.WideBinaryInstruction
NEWARRAY, SIPUSH
 
Fields inherited from class com.chaoswg.xtc4y.classdesc.code.instructions.Instruction
 
Constructor Summary
protected CPRefInstruction(byte command, com.chaoswg.xtc4y.classdesc.ConstantPoolEntry cpEntry)
          Create a new binary instruction with a command and a cp entry as operand
protected CPRefInstruction(byte command, java.io.DataInputStream dis, com.chaoswg.xtc4y.classdesc.ConstantPool cp)
          Creates an CPRefInstruction and initializes it from a DataInputStream
 
Method Summary
protected  short getOperand(com.chaoswg.xtc4y.classdesc.ConstantPool cp)
          Register cp entry on constant pool and return index
protected  void handleOperand(short operand, com.chaoswg.xtc4y.classdesc.ConstantPool cp)
          Resolve the operand as index from the cp
 java.lang.String toString()
          Write code in a readable way
 
Methods inherited from class com.chaoswg.xtc4y.classdesc.code.instructions.WideBinaryInstruction
getNumberOfUsedBytes, write
 
Methods inherited from class com.chaoswg.xtc4y.classdesc.code.instructions.Instruction
getCommand, getIndex, getOpcode, resolveIndices, setIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cpEntry

private com.chaoswg.xtc4y.classdesc.ConstantPoolEntry cpEntry

LDC_W

public static final byte LDC_W
load an int, byte, short, float, string, char from the cp

See Also:
Constant Field Values

LDC2_W

public static final byte LDC2_W
load a float or double from the cp

See Also:
Constant Field Values

GETSTATIC

public static final byte GETSTATIC
get a static field value

See Also:
Constant Field Values

PUTSTATIC

public static final byte PUTSTATIC
gput a static field value

See Also:
Constant Field Values

GETFIELD

public static final byte GETFIELD
get an instance field value

See Also:
Constant Field Values

PUTFIELD

public static final byte PUTFIELD
put an instance field value

See Also:
Constant Field Values

INVOKEVIRTUAL

public static final byte INVOKEVIRTUAL
invoke a method on an object

See Also:
Constant Field Values

INVOKESPECIAL

public static final byte INVOKESPECIAL
invoke the instance initialisation method

See Also:
Constant Field Values

INVOKESTATIC

public static final byte INVOKESTATIC
invoke a static method

See Also:
Constant Field Values

NEW

public static final byte NEW
instantiate a new object

See Also:
Constant Field Values

ANEWARRAY

public static final byte ANEWARRAY
instantiation of an array

See Also:
Constant Field Values

CHECKCAST

public static final byte CHECKCAST
check a cast

See Also:
Constant Field Values

INSTANCEOF

public static final byte INSTANCEOF
check the object instance

See Also:
Constant Field Values
Constructor Detail

CPRefInstruction

protected CPRefInstruction(byte command,
                           java.io.DataInputStream dis,
                           com.chaoswg.xtc4y.classdesc.ConstantPool cp)
                    throws java.io.IOException
Creates an CPRefInstruction and initializes it from a DataInputStream


CPRefInstruction

protected CPRefInstruction(byte command,
                           com.chaoswg.xtc4y.classdesc.ConstantPoolEntry cpEntry)
Create a new binary instruction with a command and a cp entry as operand

Method Detail

handleOperand

protected final void handleOperand(short operand,
                                   com.chaoswg.xtc4y.classdesc.ConstantPool cp)
Resolve the operand as index from the cp

Overrides:
handleOperand in class WideBinaryInstruction

getOperand

protected final short getOperand(com.chaoswg.xtc4y.classdesc.ConstantPool cp)
Register cp entry on constant pool and return index

Overrides:
getOperand in class WideBinaryInstruction

toString

public java.lang.String toString()
Write code in a readable way

Overrides:
toString in class WideBinaryInstruction