Package com.android.dx.rop.cst
Class TypedConstant
java.lang.Object
com.android.dx.rop.cst.Constant
com.android.dx.rop.cst.TypedConstant
- All Implemented Interfaces:
TypeBearer
,ToHuman
,Comparable<Constant>
- Direct Known Subclasses:
CstLiteralBits
,CstMemberRef
,CstMethodHandle
,CstProtoRef
,CstString
,CstType
Base class for constants which implement
TypeBearer
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal int
Gets the basic type corresponding to this instance's frame type.final int
Gets the basic type corresponding to this instance.final TypeBearer
Gets the frame type corresponding to this type.final boolean
Returns whether this instance represents a constant value.Methods inherited from class com.android.dx.rop.cst.Constant
compareTo, compareTo0, isCategory2, typeName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.android.dx.rop.type.TypeBearer
getType
-
Constructor Details
-
TypedConstant
public TypedConstant()
-
-
Method Details
-
getFrameType
Gets the frame type corresponding to this type. This method returnsthis
, except ifType.isIntlike()
on the underlying type returnstrue
but the underlying type is not in factType.INT
, in which case this method returns an instance whose underlying type isINT
. This implementation always returnsthis
.- Specified by:
getFrameType
in interfaceTypeBearer
- Returns:
non-null;
the frame type for this instance
-
getBasicType
public final int getBasicType()Gets the basic type corresponding to this instance.- Specified by:
getBasicType
in interfaceTypeBearer
- Returns:
- the basic type; one of the
BT_*
constants defined byType
-
getBasicFrameType
public final int getBasicFrameType()Gets the basic type corresponding to this instance's frame type. This is equivalent togetFrameType().getBasicType()
, and is the same as callinggetFrameType()
unless this instance is an int-like type, in which case this method returnsBT_INT
.- Specified by:
getBasicFrameType
in interfaceTypeBearer
- Returns:
- the basic frame type; one of the
BT_*
constants defined byType
- See Also:
-
isConstant
public final boolean isConstant()Returns whether this instance represents a constant value.- Specified by:
isConstant
in interfaceTypeBearer
- Returns:
true
if this instance represents a constant value andfalse
if not
-