org.apache.bcel.classfile
Class ConstantCP
- Cloneable, Node, Serializable
public abstract class ConstantCP
Abstract super class for Fieldref and Methodref constants.
$Id: ConstantCP.java 386056 2006-03-15 11:31:56Z tcurdt $protected int | class_index - References to the constants containing the class and the field signature
|
protected int | name_and_type_index - References to the constants containing the class and the field signature
|
accept , clone , copy , dump , equals , getComparator , getTag , hashCode , readConstant , setComparator , toString |
class_index
protected int class_index
References to the constants containing the class and the field signature
name_and_type_index
protected int name_and_type_index
References to the constants containing the class and the field signature
ConstantCP
(package private) ConstantCP(byte tag,
DataInputStream file)
throws IOException
Initialize instance from file data.
tag
- Constant type tagfile
- Input stream
ConstantCP
protected ConstantCP(byte tag,
int class_index,
int name_and_type_index)
class_index
- Reference to the class containing the fieldname_and_type_index
- and the field signature
ConstantCP
public ConstantCP(ConstantCP c)
Initialize from another object.
dump
public final void dump(DataOutputStream file)
throws IOException
Dump constant field reference to file stream in binary format.
- dump in interface Constant
file
- Output file stream
getClass
public String getClass(ConstantPool cp)
- Class this field belongs to.
getClassIndex
public final int getClassIndex()
- Reference (index) to class this field or method belongs to.
getNameAndTypeIndex
public final int getNameAndTypeIndex()
- Reference (index) to signature of the field.
setClassIndex
public final void setClassIndex(int class_index)
class_index
- points to Constant_class
setNameAndTypeIndex
public final void setNameAndTypeIndex(int name_and_type_index)
name_and_type_index
- points to Constant_NameAndType