public final class ConstantString extends Constant implements ConstantObject
Constant
and represents a reference to a String object.Constant| Modifier and Type | Field and Description |
|---|---|
private int |
string_index |
| Constructor and Description |
|---|
ConstantString(ConstantString c)
Initialize from another object.
|
ConstantString(java.io.DataInput file)
Initialize instance from file data.
|
ConstantString(int string_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)
Dump constant field reference to file stream in binary format.
|
java.lang.String |
getBytes(ConstantPool cp) |
java.lang.Object |
getConstantValue(ConstantPool cp) |
int |
getStringIndex() |
void |
setStringIndex(int string_index) |
java.lang.String |
toString() |
clone, copy, equals, getComparator, getTag, hashCode, readConstant, setComparatorpublic ConstantString(ConstantString c)
ConstantString(java.io.DataInput file)
throws java.io.IOException
file - Input streamjava.io.IOExceptionpublic ConstantString(int string_index)
string_index - Index of Constant_Utf8 in constant poolpublic void accept(Visitor v)
public final void dump(java.io.DataOutputStream file)
throws java.io.IOException
public final int getStringIndex()
public final void setStringIndex(int string_index)
string_index - the index into the constant of the string valuepublic final java.lang.String toString()
public java.lang.Object getConstantValue(ConstantPool cp)
getConstantValue in interface ConstantObjectpublic java.lang.String getBytes(ConstantPool cp)