Package com.android.dx.rop.cst
Class CstFieldRef
java.lang.Object
com.android.dx.rop.cst.Constant
com.android.dx.rop.cst.TypedConstant
com.android.dx.rop.cst.CstMemberRef
com.android.dx.rop.cst.CstFieldRef
- All Implemented Interfaces:
TypeBearer
,ToHuman
,Comparable<Constant>
Constants of type
CONSTANT_Fieldref_info
.-
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.static CstFieldRef
forPrimitiveType
(Type primitiveType) Returns an instance of this class that represents the static field which should hold the class corresponding to a given primitive type.getType()
Returns the type of this field.typeName()
Returns the human name for the particular type of constant this instance is.Methods inherited from class com.android.dx.rop.cst.CstMemberRef
equals, getDefiningClass, getNat, hashCode, isCategory2, toHuman, toString
Methods inherited from class com.android.dx.rop.cst.TypedConstant
getBasicFrameType, getBasicType, getFrameType, isConstant
-
Constructor Details
-
CstFieldRef
Constructs an instance.- Parameters:
definingClass
-non-null;
the type of the defining classnat
-non-null;
the name-and-type
-
-
Method Details
-
forPrimitiveType
Returns an instance of this class that represents the static field which should hold the class corresponding to a given primitive type. For example, if givenType.INT
, this method returns an instance corresponding to the fieldjava.lang.Integer.TYPE
.- Parameters:
primitiveType
-non-null;
the primitive type- Returns:
non-null;
the corresponding static field
-
typeName
Returns the human name for the particular type of constant this instance is. -
getType
Returns the type of this field.- Returns:
non-null;
the field's type
-
compareTo0
Compare the values of this and another instance, which are guaranteed to be of the same class. Subclasses must implement this.Note: This implementation just compares the defining class and name, and it is up to subclasses to compare the rest after calling
super.compareTo0()
.- Overrides:
compareTo0
in classCstMemberRef
- Parameters:
other
-non-null;
the instance to compare to- Returns:
-1
,0
, or1
, as usual for a comparison
-