All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class espresso.classfile.javaclass.ConstantCP

java.lang.Object
   |
   +----espresso.classfile.javaclass.Constant
           |
           +----espresso.classfile.javaclass.ConstantCP

public abstract class ConstantCP
extends Constant
Abstract super class for Fieldref and Methodref constants.

See Also:
ConstantFieldref, ConstantMethodref, ConstantInterfaceMethodref

Variable Index

 o class_index
References to the constants containing the class and the field signature
 o name_and_type_index
References to the constants containing the class and the field signature

Constructor Index

 o ConstantCP(byte, DataInputStream)
Initialize instance from file data.
 o ConstantCP(byte, int, int)
 o ConstantCP(ConstantCP)
Initialize from another object.

Method Index

 o accept(Visitor)
Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class.
 o dump(DataOutputStream)
Dump constant field reference to file stream in binary format.
 o getClassIndex()
 o getNameAndTypeIndex()
 o setClassIndex(int)
 o setNameAndTypeIndex(int)
 o toString()

Variables

 o class_index
 protected int class_index
References to the constants containing the class and the field signature

 o name_and_type_index
 protected int name_and_type_index
References to the constants containing the class and the field signature

Constructors

 o ConstantCP
 public ConstantCP(ConstantCP c)
Initialize from another object.

 o ConstantCP
 ConstantCP(byte tag,
            DataInputStream file) throws IOException
Initialize instance from file data.

Parameters:
tag - Constant type tag
file - Input stream
 o ConstantCP
 public ConstantCP(byte tag,
                   int class_index,
                   int name_and_type_index)
Parameters:
class_index - Reference to the class containing the field
name_and_type_index - and the field signature

Methods

 o dump
 public final void dump(DataOutputStream file) throws IOException
Dump constant field reference to file stream in binary format.

Parameters:
file - Output file stream
Overrides:
dump in class Constant
 o getClassIndex
 public final int getClassIndex()
Returns:
Reference (index) to class this field belongs to.
 o getNameAndTypeIndex
 public final int getNameAndTypeIndex()
Returns:
Reference (index) to signature of the field.
 o setClassIndex
 public final void setClassIndex(int class_index)
 o setNameAndTypeIndex
 public final void setNameAndTypeIndex(int name_and_type_index)
 o toString
 public final String toString()
Returns:
String representation.
Overrides:
toString in class Constant
 o accept
 public abstract void accept(Visitor v)
Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.

Parameters:
v - Visitor object
Overrides:
accept in class Constant

All Packages  Class Hierarchy  This Package  Previous  Next  Index