|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.android.dx.rop.type.Type
public final class Type
Representation of a value type, such as may appear in a field, in a
local, on a stack, or in a method descriptor. Instances of this
class are generally interned and may be usefully compared with each
other using ==.
| Field Summary | |
|---|---|
static Type |
ANNOTATION
non-null; instance representing
java.lang.annotation.Annotation |
static Type |
BOOLEAN
non-null; instance representing boolean |
static Type |
BOOLEAN_ARRAY
non-null; instance representing boolean[] |
static Type |
BOOLEAN_CLASS
non-null; instance representing java.lang.Boolean; the
suffix on the name helps disambiguate this from the instance
representing a primitive type |
static int |
BT_ADDR
basic type constant for a return address |
static int |
BT_BOOLEAN
basic type constant for boolean |
static int |
BT_BYTE
basic type constant for byte |
static int |
BT_CHAR
basic type constant for char |
static int |
BT_COUNT
count of basic type constants |
static int |
BT_DOUBLE
basic type constant for double |
static int |
BT_FLOAT
basic type constant for float |
static int |
BT_INT
basic type constant for int |
static int |
BT_LONG
basic type constant for long |
static int |
BT_OBJECT
basic type constant for Object |
static int |
BT_SHORT
basic type constant for short |
static int |
BT_VOID
basic type constant for void |
static Type |
BYTE
non-null; instance representing byte |
static Type |
BYTE_ARRAY
non-null; instance representing byte[] |
static Type |
BYTE_CLASS
non-null; instance representing java.lang.Byte; the
suffix on the name helps disambiguate this from the instance
representing a primitive type |
static Type |
CHAR
non-null; instance representing char |
static Type |
CHAR_ARRAY
non-null; instance representing char[] |
static Type |
CHARACTER_CLASS
non-null; instance representing java.lang.Character; the
suffix on the name helps disambiguate this from the instance
representing a primitive type |
static Type |
CLASS
non-null; instance representing java.lang.Class |
static Type |
CLONEABLE
non-null; instance representing java.lang.Cloneable |
static Type |
DOUBLE
non-null; instance representing double |
static Type |
DOUBLE_ARRAY
non-null; instance representing double[] |
static Type |
DOUBLE_CLASS
non-null; instance representing java.lang.Double; the
suffix on the name helps disambiguate this from the instance
representing a primitive type |
static Type |
FLOAT
non-null; instance representing float |
static Type |
FLOAT_ARRAY
non-null; instance representing float[] |
static Type |
FLOAT_CLASS
non-null; instance representing java.lang.Float; the
suffix on the name helps disambiguate this from the instance
representing a primitive type |
static Type |
INT
non-null; instance representing int |
static Type |
INT_ARRAY
non-null; instance representing int[] |
static Type |
INTEGER_CLASS
non-null; instance representing java.lang.Integer; the
suffix on the name helps disambiguate this from the instance
representing a primitive type |
static Type |
KNOWN_NULL
non-null; instance representing a known-null |
static Type |
LONG
non-null; instance representing long |
static Type |
LONG_ARRAY
non-null; instance representing long[] |
static Type |
LONG_CLASS
non-null; instance representing java.lang.Long; the
suffix on the name helps disambiguate this from the instance
representing a primitive type |
static Type |
OBJECT
non-null; instance representing java.lang.Object |
static Type |
OBJECT_ARRAY
non-null; instance representing Object[] |
static Type |
RETURN_ADDRESS
non-null; instance representing a subroutine return address |
static Type |
SERIALIZABLE
non-null; instance representing java.io.Serializable |
static Type |
SHORT
non-null; instance representing short |
static Type |
SHORT_ARRAY
non-null; instance representing short[] |
static Type |
SHORT_CLASS
non-null; instance representing java.lang.Short; the
suffix on the name helps disambiguate this from the instance
representing a primitive type |
static Type |
STRING
non-null; instance representing java.lang.String |
static Type |
THROWABLE
non-null; instance representing java.lang.Throwable |
static Type |
VOID
non-null; instance representing void |
static Type |
VOID_CLASS
non-null; instance representing java.lang.Void; the
suffix on the name helps disambiguate this from the instance
representing a primitive type |
| Method Summary | |
|---|---|
Type |
asUninitialized(int newAt)
Returns a new interned instance which is identical to this one, except it is indicated as uninitialized and allocated at the given bytecode index. |
int |
compareTo(Type other)
|
boolean |
equals(Object other)
|
Type |
getArrayType()
Gets the type corresponding to an array of this type. |
int |
getBasicFrameType()
Gets the basic type corresponding to this instance's frame type. |
int |
getBasicType()
Gets the basic type corresponding to this instance. |
int |
getCategory()
Gets the category. |
String |
getClassName()
Gets the name of the class this type corresponds to, in internal form. |
Type |
getComponentType()
Gets the component type of this type. |
String |
getDescriptor()
Gets the descriptor. |
Type |
getFrameType()
Gets the frame type corresponding to this type. |
Type |
getInitializedType()
Gets the initialized type corresponding to this instance, but only if this instance is in fact an uninitialized object type. |
int |
getNewAt()
Gets the bytecode index at which this uninitialized type was allocated. |
Type |
getType()
Gets the type associated with this instance. |
int |
hashCode()
|
static Type |
intern(String descriptor)
Returns the unique instance corresponding to the type with the given descriptor. |
static Type |
internClassName(String name)
Returns the unique instance corresponding to the type of the class with the given name. |
static Type |
internReturnType(String descriptor)
Returns the unique instance corresponding to the type with the given descriptor, allowing "V" to return the type
for void. |
boolean |
isArray()
Gets whether this type is an array type. |
boolean |
isArrayOrKnownNull()
Gets whether this type is an array type or is a known-null, and hence is compatible with array types. |
boolean |
isCategory1()
Returns whether or not this is a category 1 type. |
boolean |
isCategory2()
Returns whether or not this is a category 2 type. |
boolean |
isConstant()
Returns whether this instance represents a constant value. |
boolean |
isIntlike()
Gets whether this type is "intlike." An intlike type is one which, when placed on a stack or in a local, is automatically converted to an int. |
boolean |
isPrimitive()
Gets whether this type is a primitive type. |
boolean |
isReference()
Gets whether this type is a normal reference type. |
boolean |
isUninitialized()
Gets whether this type represents an uninitialized instance. |
String |
toHuman()
Return the "human" string form of this instance. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int BT_VOID
void
public static final int BT_BOOLEAN
boolean
public static final int BT_BYTE
byte
public static final int BT_CHAR
char
public static final int BT_DOUBLE
double
public static final int BT_FLOAT
float
public static final int BT_INT
int
public static final int BT_LONG
long
public static final int BT_SHORT
short
public static final int BT_OBJECT
Object
public static final int BT_ADDR
public static final int BT_COUNT
public static final Type BOOLEAN
non-null; instance representing boolean
public static final Type BYTE
non-null; instance representing byte
public static final Type CHAR
non-null; instance representing char
public static final Type DOUBLE
non-null; instance representing double
public static final Type FLOAT
non-null; instance representing float
public static final Type INT
non-null; instance representing int
public static final Type LONG
non-null; instance representing long
public static final Type SHORT
non-null; instance representing short
public static final Type VOID
non-null; instance representing void
public static final Type KNOWN_NULL
non-null; instance representing a known-null
public static final Type RETURN_ADDRESS
non-null; instance representing a subroutine return address
public static final Type ANNOTATION
non-null; instance representing
java.lang.annotation.Annotation
public static final Type CLASS
non-null; instance representing java.lang.Class
public static final Type CLONEABLE
non-null; instance representing java.lang.Cloneable
public static final Type OBJECT
non-null; instance representing java.lang.Object
public static final Type SERIALIZABLE
non-null; instance representing java.io.Serializable
public static final Type STRING
non-null; instance representing java.lang.String
public static final Type THROWABLE
non-null; instance representing java.lang.Throwable
public static final Type BOOLEAN_CLASS
non-null; instance representing java.lang.Boolean; the
suffix on the name helps disambiguate this from the instance
representing a primitive type
public static final Type BYTE_CLASS
non-null; instance representing java.lang.Byte; the
suffix on the name helps disambiguate this from the instance
representing a primitive type
public static final Type CHARACTER_CLASS
non-null; instance representing java.lang.Character; the
suffix on the name helps disambiguate this from the instance
representing a primitive type
public static final Type DOUBLE_CLASS
non-null; instance representing java.lang.Double; the
suffix on the name helps disambiguate this from the instance
representing a primitive type
public static final Type FLOAT_CLASS
non-null; instance representing java.lang.Float; the
suffix on the name helps disambiguate this from the instance
representing a primitive type
public static final Type INTEGER_CLASS
non-null; instance representing java.lang.Integer; the
suffix on the name helps disambiguate this from the instance
representing a primitive type
public static final Type LONG_CLASS
non-null; instance representing java.lang.Long; the
suffix on the name helps disambiguate this from the instance
representing a primitive type
public static final Type SHORT_CLASS
non-null; instance representing java.lang.Short; the
suffix on the name helps disambiguate this from the instance
representing a primitive type
public static final Type VOID_CLASS
non-null; instance representing java.lang.Void; the
suffix on the name helps disambiguate this from the instance
representing a primitive type
public static final Type BOOLEAN_ARRAY
non-null; instance representing boolean[]
public static final Type BYTE_ARRAY
non-null; instance representing byte[]
public static final Type CHAR_ARRAY
non-null; instance representing char[]
public static final Type DOUBLE_ARRAY
non-null; instance representing double[]
public static final Type FLOAT_ARRAY
non-null; instance representing float[]
public static final Type INT_ARRAY
non-null; instance representing int[]
public static final Type LONG_ARRAY
non-null; instance representing long[]
public static final Type OBJECT_ARRAY
non-null; instance representing Object[]
public static final Type SHORT_ARRAY
non-null; instance representing short[]
| Method Detail |
|---|
public static Type intern(String descriptor)
"V" (that is, type void) as a valid
descriptor.
descriptor - non-null; the descriptor
non-null; the corresponding instance
IllegalArgumentException - thrown if the descriptor has
invalid syntaxpublic static Type internReturnType(String descriptor)
"V" to return the type
for void. Other than that one caveat, this method
is identical to intern(java.lang.String).
descriptor - non-null; the descriptor
non-null; the corresponding instance
IllegalArgumentException - thrown if the descriptor has
invalid syntaxpublic static Type internClassName(String name)
intern(name) if name begins
with "[" and calling intern("L" + name + ";")
in all other cases.
name - non-null; the name of the class whose type
is desired
non-null; the corresponding type
IllegalArgumentException - thrown if the name has
invalid syntaxpublic boolean equals(Object other)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic int compareTo(Type other)
compareTo in interface Comparable<Type>public String toString()
toString in class Objectpublic String toHuman()
toString().
toHuman in interface ToHumannon-null; the human string formpublic Type getType()
getType in interface TypeBearernon-null; the typepublic Type getFrameType()
this, except if isIntlike() on the underlying
type returns true but the underlying type is not in
fact INT, in which case this method returns an instance
whose underlying type is INT.
getFrameType in interface TypeBearernon-null; the frame type for this instancepublic int getBasicType()
getBasicType in interface TypeBearerBT_* constants
defined by Typepublic int getBasicFrameType()
getFrameType().getBasicType(), and
is the same as calling getFrameType() unless this
instance is an int-like type, in which case this method returns
BT_INT.
getBasicFrameType in interface TypeBearerBT_* constants
defined by TypeTypeBearer.getBasicType(),
TypeBearer.getFrameType()public boolean isConstant()
isConstant in interface TypeBearertrue if this instance represents a constant value
and false if notpublic String getDescriptor()
non-null; the descriptorpublic String getClassName()
non-null; the internal-form class namepublic int getCategory()
long
and double are the only category 2 types.
isCategory1(),
isCategory2()public boolean isCategory1()
getCategory(),
isCategory2()public boolean isCategory2()
getCategory(),
isCategory1()public boolean isIntlike()
int.
public boolean isPrimitive()
public boolean isReference()
getBasicType() == Type.BT_OBJECT.
public boolean isArray()
true, then it is safe to use getComponentType()
to determine the component type.
public boolean isArrayOrKnownNull()
public boolean isUninitialized()
new
opcode, and remains uninitialized until a valid constructor is
invoked on it.
public int getNewAt()
Integer.MAX_VALUE if this
type is an uninitialized incoming parameter (i.e., the
this of an <init> method) or
-1 if this type is in fact initialized.
>= -1; the allocation bytecode indexpublic Type getInitializedType()
non-null; the initialized typepublic Type getArrayType()
non-null; the array typepublic Type getComponentType()
non-null; the component typepublic Type asUninitialized(int newAt)
newAt - >= 0; the allocation bytecode index
non-null; an appropriately-constructed instance
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||