public final class CstNat extends Constant
CONSTANT_NameAndType_info.| Modifier and Type | Field and Description |
|---|---|
static CstNat |
PRIMITIVE_TYPE_NAT
non-null; the instance for name TYPE and descriptor
java.lang.Class, which is useful when dealing with
wrapped primitives |
| Constructor and Description |
|---|
CstNat(CstString name,
CstString descriptor)
Constructs an instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
compareTo0(Constant other)
Compare the values of this and another instance, which are guaranteed
to be of the same class.
|
boolean |
equals(Object other) |
CstString |
getDescriptor()
Gets the descriptor.
|
Type |
getFieldType()
Gets the field type corresponding to this instance's descriptor.
|
CstString |
getName()
Gets the name.
|
int |
hashCode() |
boolean |
isCategory2()
Returns
true if this instance is a category-2 constant,
meaning it takes up two slots in the constant pool, or
false if this instance is category-1. |
boolean |
isClassInit()
Gets whether this instance has the name of a standard class
initialization method.
|
boolean |
isInstanceInit()
Gets whether this instance has the name of a standard instance
initialization method.
|
String |
toHuman()
Returns an unadorned but human-readable version of the name-and-type
value.
|
String |
toString() |
String |
typeName()
Returns the human name for the particular type of constant
this instance is.
|
public static final CstNat PRIMITIVE_TYPE_NAT
non-null; the instance for name TYPE and descriptor
java.lang.Class, which is useful when dealing with
wrapped primitivesprotected int compareTo0(Constant other)
compareTo0 in class Constantother - non-null; the instance to compare to-1, 0, or 1, as usual
for a comparisonpublic String typeName()
public boolean isCategory2()
true if this instance is a category-2 constant,
meaning it takes up two slots in the constant pool, or
false if this instance is category-1.isCategory2 in class Constanttrue iff this instance is category-2public CstString getName()
non-null; the namepublic CstString getDescriptor()
non-null; the descriptorpublic String toHuman()
non-null; the human formpublic Type getFieldType()
non-null; the field typepublic final boolean isInstanceInit()
getName().getString().equals("<init>").true iff this is a reference to an
instance initialization methodpublic final boolean isClassInit()
getName().getString().equals("<clinit>").true iff this is a reference to an
instance initialization methodCopyright © 2016. All Rights Reserved.