harpoon.IR.RawClass
Class ConstantFieldref

java.lang.Object
  extended by harpoon.IR.RawClass.Constant
      extended by harpoon.IR.RawClass.ConstantFieldref

public class ConstantFieldref
extends Constant

The CONSTANT_Fieldref structure represents a field.

Version:
$Id: ConstantFieldref.java,v 1.2 2002/02/25 21:05:26 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
"The Java Virtual Machine Specification, section 4.4.2", Constant, ConstantMethodref, ConstantInterfaceMethodref

Field Summary
 int class_index
          The value of the class_index item must be a valid index into the constant_pool table of the parent.
 int name_and_type_index
          The value of the name_and_type_index item must be a valid index into the constant_pool table of the parent.
 
Fields inherited from class harpoon.IR.RawClass.Constant
parent
 
Constructor Summary
ConstantFieldref(ClassFile parent, int class_index, int name_and_type_index)
          Constructor.
 
Method Summary
 ConstantClass class_index()
           
 ConstantNameAndType name_and_type_index()
           
 String toString()
          Create a human-readable representation of this constant.
 void write(ClassDataOutputStream out)
          Write to a bytecode file.
 
Methods inherited from class harpoon.IR.RawClass.Constant
entrySize, print, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

class_index

public int class_index
The value of the class_index item must be a valid index into the constant_pool table of the parent. The constant_pool entry at that index must be a CONSTANT_Class_info structure representing the class or interface type that contains the declaration of the field.

The class_index item of a CONSTANT_Fieldref must be a class type, not an interface type.


name_and_type_index

public int name_and_type_index
The value of the name_and_type_index item must be a valid index into the constant_pool table of the parent. The constant_pool entry at that index must be a CONSTANT_NameAndType_info structure. This constant_pool entry indicates the name and descriptor of the field.

Constructor Detail

ConstantFieldref

public ConstantFieldref(ClassFile parent,
                        int class_index,
                        int name_and_type_index)
Constructor.

Method Detail

write

public void write(ClassDataOutputStream out)
           throws IOException
Write to a bytecode file.

Specified by:
write in class Constant
Throws:
IOException - on error writing to output stream.

class_index

public ConstantClass class_index()

name_and_type_index

public ConstantNameAndType name_and_type_index()

toString

public String toString()
Create a human-readable representation of this constant.

Overrides:
toString in class Constant