public class NameAndTypeConstant extends Constant
Constant represents a name and type constant in the constant pool.| Modifier and Type | Field and Description |
|---|---|
int |
u2descriptorIndex |
int |
u2nameIndex |
CLASS, DOUBLE, DYNAMIC, FIELDREF, FLOAT, INTEGER, INTERFACE_METHODREF, INVOKE_DYNAMIC, LONG, METHOD_HANDLE, METHOD_TYPE, METHODREF, MODULE, NAME_AND_TYPE, PACKAGE, PRIMITIVE_ARRAY, STRING, UTF8processingFlags, processingInfo| Constructor and Description |
|---|
NameAndTypeConstant()
Creates an uninitialized NameAndTypeConstant.
|
NameAndTypeConstant(int u2nameIndex,
int u2descriptorIndex)
Creates a new NameAndTypeConstant with the given name and type indices.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(Clazz clazz,
ConstantVisitor constantVisitor)
Accepts the given visitor.
|
boolean |
equals(java.lang.Object object) |
protected int |
getDescriptorIndex()
Returns the descriptor index.
|
java.lang.String |
getName(Clazz clazz)
Returns the name.
|
protected int |
getNameIndex()
Returns the name index.
|
int |
getTag()
Returns the constant pool info tag that specifies the entry type.
|
java.lang.String |
getType(Clazz clazz)
Returns the type.
|
int |
hashCode() |
boolean |
isCategory2()
Returns whether the constant is of category 2.
|
protected void |
setDescriptorIndex(int index)
Sets the descriptor index.
|
protected void |
setNameIndex(int index)
Sets the name index.
|
java.lang.String |
toString() |
getProcessingFlags, getProcessingInfo, setProcessingFlags, setProcessingInfopublic NameAndTypeConstant()
public NameAndTypeConstant(int u2nameIndex,
int u2descriptorIndex)
u2nameIndex - the index of the name in the constant pool.u2descriptorIndex - the index of the descriptor in the constant
pool.protected int getNameIndex()
protected void setNameIndex(int index)
protected int getDescriptorIndex()
protected void setDescriptorIndex(int index)
public java.lang.String getName(Clazz clazz)
public java.lang.String getType(Clazz clazz)
public int getTag()
Constantpublic boolean isCategory2()
ConstantisCategory2 in class Constantpublic void accept(Clazz clazz, ConstantVisitor constantVisitor)
Constantpublic boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object