Package com.android.dx.rop.cst
Class CstNat
java.lang.Object
com.android.dx.rop.cst.Constant
com.android.dx.rop.cst.CstNat
- All Implemented Interfaces:
ToHuman
,Comparable<Constant>
Constants of type
CONSTANT_NameAndType_info
.-
Field Summary
Modifier and TypeFieldDescriptionstatic final CstNat
non-null;
the instance for nameTYPE
and descriptorjava.lang.Class
, which is useful when dealing with wrapped primitives -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected int
compareTo0
(Constant other) Compare the values of this and another instance, which are guaranteed to be of the same class.boolean
Gets the descriptor.Gets the field type corresponding to this instance's descriptor.getName()
Gets the name.int
hashCode()
boolean
Returnstrue
if this instance is a category-2 constant, meaning it takes up two slots in the constant pool, orfalse
if this instance is category-1.final boolean
Gets whether this instance has the name of a standard class initialization method.final boolean
Gets whether this instance has the name of a standard instance initialization method.toHuman()
Returns an unadorned but human-readable version of the name-and-type value.toString()
typeName()
Returns the human name for the particular type of constant this instance is.
-
Field Details
-
PRIMITIVE_TYPE_NAT
non-null;
the instance for nameTYPE
and descriptorjava.lang.Class
, which is useful when dealing with wrapped primitives
-
-
Constructor Details
-
CstNat
Constructs an instance.- Parameters:
name
-non-null;
the namedescriptor
-non-null;
the descriptor
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
compareTo0
Compare the values of this and another instance, which are guaranteed to be of the same class. Subclasses must implement this.- Specified by:
compareTo0
in classConstant
- Parameters:
other
-non-null;
the instance to compare to- Returns:
-1
,0
, or1
, as usual for a comparison
-
toString
-
typeName
Returns the human name for the particular type of constant this instance is. -
isCategory2
public boolean isCategory2()Returnstrue
if this instance is a category-2 constant, meaning it takes up two slots in the constant pool, orfalse
if this instance is category-1.- Specified by:
isCategory2
in classConstant
- Returns:
true
iff this instance is category-2
-
getName
Gets the name.- Returns:
non-null;
the name
-
getDescriptor
Gets the descriptor.- Returns:
non-null;
the descriptor
-
toHuman
Returns an unadorned but human-readable version of the name-and-type value.- Returns:
non-null;
the human form
-
getFieldType
Gets the field type corresponding to this instance's descriptor. This method is only valid to call if the descriptor in fact describes a field (and not a method).- Returns:
non-null;
the field type
-
isInstanceInit
public final boolean isInstanceInit()Gets whether this instance has the name of a standard instance initialization method. This is just a convenient shorthand forgetName().getString().equals("<init>")
.- Returns:
true
iff this is a reference to an instance initialization method
-
isClassInit
public final boolean isClassInit()Gets whether this instance has the name of a standard class initialization method. This is just a convenient shorthand forgetName().getString().equals("<clinit>")
.- Returns:
true
iff this is a reference to an instance initialization method
-