ConstantCPpublic abstract class ConstantCP extends Constant Abstract super class for Fieldref and Methodref constants. |
Fields Summary |
---|
protected int | class_indexReferences to the constants containing the class and the field signature | protected int | name_and_type_index |
Constructors Summary |
---|
public ConstantCP(ConstantCP c)Initialize from another object.
this(c.getTag(), c.getClassIndex(), c.getNameAndTypeIndex());
| ConstantCP(byte tag, DataInputStream file)Initialize instance from file data.
this(tag, file.readUnsignedShort(), file.readUnsignedShort());
| protected ConstantCP(byte tag, int class_index, int name_and_type_index)
super(tag);
this.class_index = class_index;
this.name_and_type_index = name_and_type_index;
|
Methods Summary |
---|
public final void | dump(java.io.DataOutputStream file)Dump constant field reference to file stream in binary format.
file.writeByte(tag);
file.writeShort(class_index);
file.writeShort(name_and_type_index);
| public java.lang.String | getClass(com.sun.org.apache.bcel.internal.classfile.ConstantPool cp)
return cp.constantToString(class_index, Constants.CONSTANT_Class);
| public final int | getClassIndex() return class_index;
| public final int | getNameAndTypeIndex() return name_and_type_index;
| public final void | setClassIndex(int class_index)
this.class_index = class_index;
| public final void | setNameAndTypeIndex(int name_and_type_index)
this.name_and_type_index = name_and_type_index;
| public final java.lang.String | toString()
return super.toString() + "(class_index = " + class_index +
", name_and_type_index = " + name_and_type_index + ")";
|
|