Package com.android.dx.rop.cst
Class CstType
java.lang.Object
com.android.dx.rop.cst.Constant
com.android.dx.rop.cst.TypedConstant
com.android.dx.rop.cst.CstType
- All Implemented Interfaces:
TypeBearer
,ToHuman
,Comparable<Constant>
Constants that represent an arbitrary type (reference or primitive).
-
Field Summary
Modifier and TypeFieldDescriptionstatic final CstType
non-null;
instance corresponding to the classBoolean
static final CstType
non-null;
instance corresponding to the typeboolean[]
static final CstType
non-null;
instance corresponding to the classByte
static final CstType
non-null;
instance corresponding to the typebyte[]
static final CstType
non-null;
instance corresponding to the typechar[]
static final CstType
non-null;
instance corresponding to the classCharacter
static final CstType
non-null;
instance corresponding to the classDouble
static final CstType
non-null;
instance corresponding to the typedouble[]
static final CstType
non-null;
instance corresponding to the classFloat
static final CstType
non-null;
instance corresponding to the typefloat[]
static final CstType
non-null;
instance corresponding to the typeint[]
static final CstType
non-null;
instance corresponding to the classInteger
static final CstType
non-null;
instance corresponding to the classLong
static final CstType
non-null;
instance corresponding to the typelong[]
static final CstType
non-null;
instance corresponding to the typejava.lang.invoke.MethodHandle
static final CstType
non-null;
instance corresponding to the classObject
static final CstType
non-null;
instance corresponding to the classShort
static final CstType
non-null;
instance corresponding to the typeshort[]
static final CstType
non-null;
instance corresponding to the typejava.lang.invoke.VarHandle
static final CstType
non-null;
instance corresponding to the classVoid
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
protected int
compareTo0
(Constant other) Compare the values of this and another instance, which are guaranteed to be of the same class.boolean
static CstType
forBoxedPrimitiveType
(Type primitiveType) Returns an instance of this class that represents the wrapper class corresponding to a given primitive type.Gets the underlying type (as opposed to the type corresponding to this instance as a constant, which is alwaysClass
).Gets the type descriptor for this instance.Returns a human readable package name for this type, like "java.util".getType()
Gets the type associated with this instance.int
hashCode()
static CstType
Returns an interned instance of this class for the given type.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.toHuman()
Return the "human" string form of this instance.toString()
typeName()
Returns the human name for the particular type of constant this instance is.Methods inherited from class com.android.dx.rop.cst.TypedConstant
getBasicFrameType, getBasicType, getFrameType, isConstant
-
Field Details
-
OBJECT
non-null;
instance corresponding to the classObject
-
BOOLEAN
non-null;
instance corresponding to the classBoolean
-
BYTE
non-null;
instance corresponding to the classByte
-
CHARACTER
non-null;
instance corresponding to the classCharacter
-
DOUBLE
non-null;
instance corresponding to the classDouble
-
FLOAT
non-null;
instance corresponding to the classFloat
-
LONG
non-null;
instance corresponding to the classLong
-
INTEGER
non-null;
instance corresponding to the classInteger
-
SHORT
non-null;
instance corresponding to the classShort
-
VOID
non-null;
instance corresponding to the classVoid
-
BOOLEAN_ARRAY
non-null;
instance corresponding to the typeboolean[]
-
BYTE_ARRAY
non-null;
instance corresponding to the typebyte[]
-
CHAR_ARRAY
non-null;
instance corresponding to the typechar[]
-
DOUBLE_ARRAY
non-null;
instance corresponding to the typedouble[]
-
FLOAT_ARRAY
non-null;
instance corresponding to the typefloat[]
-
LONG_ARRAY
non-null;
instance corresponding to the typelong[]
-
INT_ARRAY
non-null;
instance corresponding to the typeint[]
-
SHORT_ARRAY
non-null;
instance corresponding to the typeshort[]
-
METHOD_HANDLE
non-null;
instance corresponding to the typejava.lang.invoke.MethodHandle
-
VAR_HANDLE
non-null;
instance corresponding to the typejava.lang.invoke.VarHandle
-
-
Constructor Details
-
CstType
Constructs an instance.- Parameters:
type
-non-null;
the underlying type
-
-
Method Details
-
forBoxedPrimitiveType
Returns an instance of this class that represents the wrapper class corresponding to a given primitive type. For example, if givenType.INT
, this method returns the class referencejava.lang.Integer
.- Parameters:
primitiveType
-non-null;
the primitive type- Returns:
non-null;
the corresponding wrapper class
-
intern
Returns an interned instance of this class for the given type.- Parameters:
type
-non-null;
the underlying type- Returns:
non-null;
an appropriately-constructed instance
-
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
-
getType
Gets the type associated with this instance.- Returns:
non-null;
the type
-
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
-
toHuman
Return the "human" string form of this instance. This is generally less "debuggy" thantoString()
.- Returns:
non-null;
the human string form
-
getClassType
Gets the underlying type (as opposed to the type corresponding to this instance as a constant, which is alwaysClass
).- Returns:
non-null;
the type corresponding to the name
-
getDescriptor
Gets the type descriptor for this instance.- Returns:
non-null;
the descriptor
-
getPackageName
Returns a human readable package name for this type, like "java.util". If this is an array type, this returns the package name of the array's component type. If this is a primitive type, this returns "default". -
clearInternTable
public static void clearInternTable()
-