java.lang.Object
org.apache.bcel.classfile.Constant
org.apache.bcel.classfile.ConstantCP
- All Implemented Interfaces:
- java.lang.Cloneable, Node, java.io.Serializable
- Direct Known Subclasses:
- ConstantFieldref, ConstantInterfaceMethodref, ConstantMethodref
- public abstract class ConstantCP
- extends Constant
Abstract super class for Fieldref and Methodref constants.
- Version:
- $Id: ConstantCP.java 386056 2006-03-15 11:31:56Z tcurdt $
|
Field Summary |
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 |
| Fields inherited from class org.apache.bcel.classfile.Constant |
tag |
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
public ConstantCP(ConstantCP c)
- Initialize from another object.
ConstantCP
ConstantCP(byte tag,
java.io.DataInputStream file)
throws java.io.IOException
- Initialize instance from file data.
ConstantCP
protected ConstantCP(byte tag,
int class_index,
int name_and_type_index)
dump
public final void dump(java.io.DataOutputStream file)
throws java.io.IOException
- Dump constant field reference to file stream in binary format.
- Specified by:
dump in class Constant
getClassIndex
public final int getClassIndex()
getNameAndTypeIndex
public final int getNameAndTypeIndex()
setClassIndex
public final void setClassIndex(int class_index)
getClass
public java.lang.String getClass(ConstantPool cp)
setNameAndTypeIndex
public final void setNameAndTypeIndex(int name_and_type_index)
toString
public final java.lang.String toString()
- Description copied from class:
java.lang.Object
- Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method
never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string
concatenation with this object. If the result is
null, string concatenation will instead
use "null".
The default implementation returns
getClass().getName() + "@" +
Integer.toHexString(hashCode()).
- Overrides:
toString in class Constant