harpoon.IR.RawClass
Class ConstantNameAndType

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

public class ConstantNameAndType
extends Constant

The CONSTANT_NameAndType_info structure is used to represent a field or method, without indicating which class or interface type it belongs to.

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

Field Summary
 int descriptor_index
          the value of the descriptor_index must be a valid index into the constant_pool table.
 int name_index
          The value of the name_index must be a valid index into the constant_pool table.
 
Fields inherited from class harpoon.IR.RawClass.Constant
parent
 
Constructor Summary
ConstantNameAndType(ClassFile parent, int name_index, int descriptor_index)
          Constructor.
 
Method Summary
 ConstantUtf8 descriptor_index()
           
 String descriptor()
           
 ConstantUtf8 name_index()
           
 String name()
           
 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

name_index

public int name_index
The value of the name_index must be a valid index into the constant_pool table. The constant_pool entry at that index must be a CONSTANT_Utf8_info structure representing a valid Java field name or method name stored as a simple (not fully qualified) name, that is, as a Java identifier.


descriptor_index

public int descriptor_index
the value of the descriptor_index must be a valid index into the constant_pool table. The constant_pool entry at that index must be a CONSTANT_Utf8_info structure representing a valid Java field descriptor or method descriptor.

Constructor Detail

ConstantNameAndType

public ConstantNameAndType(ClassFile parent,
                           int name_index,
                           int descriptor_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.

name_index

public ConstantUtf8 name_index()

descriptor_index

public ConstantUtf8 descriptor_index()

name

public String name()

descriptor

public String descriptor()

toString

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

Overrides:
toString in class Constant