public final class ConstantClass extends Constant implements ConstantObject
Constant
and represents a reference to a (external) class.Constant| Modifier and Type | Field and Description |
|---|---|
private int |
name_index |
| Constructor and Description |
|---|
ConstantClass(ConstantClass c)
Initialize from another object.
|
ConstantClass(java.io.DataInput dataInput)
Constructs an instance from file data.
|
ConstantClass(int name_index) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(Visitor v)
Called by objects that are traversing the nodes of the tree implicitely
defined by the contents of a Java class.
|
void |
dump(java.io.DataOutputStream file)
Dumps constant class to file stream in binary format.
|
java.lang.String |
getBytes(ConstantPool cp) |
java.lang.Object |
getConstantValue(ConstantPool cp) |
int |
getNameIndex() |
void |
setNameIndex(int name_index) |
java.lang.String |
toString() |
clone, copy, equals, getComparator, getTag, hashCode, readConstant, setComparatorpublic ConstantClass(ConstantClass c)
ConstantClass(java.io.DataInput dataInput)
throws java.io.IOException
dataInput - Input streamjava.io.IOException - if an I/O error occurs reading from the given dataInput.public ConstantClass(int name_index)
name_index - Name index in constant pool. Should refer to a
ConstantUtf8.public void accept(Visitor v)
public final void dump(java.io.DataOutputStream file)
throws java.io.IOException
public final int getNameIndex()
public final void setNameIndex(int name_index)
name_index - the name index in the constant pool of this Constant Classpublic java.lang.Object getConstantValue(ConstantPool cp)
getConstantValue in interface ConstantObjectpublic java.lang.String getBytes(ConstantPool cp)