org.apache.bcel.classfile
Class ConstantNameAndType
- Cloneable, Node, Serializable
public final class ConstantNameAndType
This class is derived from the abstract
Constant class
and represents a reference to the name and signature
of a field or method.
$Id: ConstantNameAndType.java,v 1.2 2002/03/11 16:16:35 mdahm Exp $
ConstantNameAndType
public ConstantNameAndType(int name_index,
int signature_index)
name_index
- Name of field/methodsignature_index
- and its signature
ConstantNameAndType
public ConstantNameAndType(ConstantNameAndType c)
Initialize from another object.
accept
public 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.
- accept in interface Node
- accept in interface Constant
dump
public final void dump(DataOutputStream file)
throws IOException
Dump name and signature index to file stream in binary format.
- dump in interface Constant
file
- Output file stream
getNameIndex
public final int getNameIndex()
- Name index in constant pool of field/method name.
getSignature
public final String getSignature(ConstantPool cp)
getSignatureIndex
public final int getSignatureIndex()
- Index in constant pool of field/method signature.
setNameIndex
public final void setNameIndex(int name_index)
setSignatureIndex
public final void setSignatureIndex(int signature_index)