Package com.android.dx.rop.cst
Class CstMethodHandle
java.lang.Object
com.android.dx.rop.cst.Constant
com.android.dx.rop.cst.TypedConstant
com.android.dx.rop.cst.CstMethodHandle
- All Implemented Interfaces:
TypeBearer
,ToHuman
,Comparable<Constant>
Constants of type
MethodHandle
.-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
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.int
Gets the type of this method handle.static String
getMethodHandleTypeName
(int type) Gets a human readable name for a method handle type.getRef()
Gets the actual constant.getType()
Gets the type associated with this instance.boolean
Reports whether the method handle is a field accessor.static boolean
isAccessor
(int type) Reports whether the method handle type is a field accessor.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.boolean
Reports whether the method handle is a method invocation.static boolean
isInvocation
(int type) Reports whether the method handle type is a method invocation.static CstMethodHandle
Makes an instance for the given value.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
-
METHOD_HANDLE_TYPE_STATIC_PUT
public static final int METHOD_HANDLE_TYPE_STATIC_PUT- See Also:
-
METHOD_HANDLE_TYPE_STATIC_GET
public static final int METHOD_HANDLE_TYPE_STATIC_GET- See Also:
-
METHOD_HANDLE_TYPE_INSTANCE_PUT
public static final int METHOD_HANDLE_TYPE_INSTANCE_PUT- See Also:
-
METHOD_HANDLE_TYPE_INSTANCE_GET
public static final int METHOD_HANDLE_TYPE_INSTANCE_GET- See Also:
-
METHOD_HANDLE_TYPE_INVOKE_STATIC
public static final int METHOD_HANDLE_TYPE_INVOKE_STATIC- See Also:
-
METHOD_HANDLE_TYPE_INVOKE_INSTANCE
public static final int METHOD_HANDLE_TYPE_INVOKE_INSTANCE- See Also:
-
METHOD_HANDLE_TYPE_INVOKE_CONSTRUCTOR
public static final int METHOD_HANDLE_TYPE_INVOKE_CONSTRUCTOR- See Also:
-
METHOD_HANDLE_TYPE_INVOKE_DIRECT
public static final int METHOD_HANDLE_TYPE_INVOKE_DIRECT- See Also:
-
METHOD_HANDLE_TYPE_INVOKE_INTERFACE
public static final int METHOD_HANDLE_TYPE_INVOKE_INTERFACE- See Also:
-
-
Method Details
-
make
Makes an instance for the given value. This may (but does not necessarily) return an already-allocated instance.- Parameters:
type
- the type of this handleref
-non-null;
the referenced field or method constant- Returns:
non-null;
the appropriate instance
-
getRef
Gets the actual constant.- Returns:
- the value
-
getMethodHandleType
public int getMethodHandleType()Gets the type of this method handle.- Returns:
- the type
-
isAccessor
public static boolean isAccessor(int type) Reports whether the method handle type is a field accessor.- Parameters:
type
- the method handle type- Returns:
- true if the method handle type is a field accessor, false otherwise
-
isAccessor
public boolean isAccessor()Reports whether the method handle is a field accessor.- Returns:
- true if the method handle is a field accessor, false otherwise
-
isInvocation
public static boolean isInvocation(int type) Reports whether the method handle type is a method invocation.- Parameters:
type
- the method handle type- Returns:
- true if the method handle type is a method invocation, false otherwise
-
isInvocation
public boolean isInvocation()Reports whether the method handle is a method invocation.- Returns:
- true if the method handle is a method invocation, false otherwise
-
getMethodHandleTypeName
Gets a human readable name for a method handle type.- Parameters:
type
- the method handle type- Returns:
- the string representation of the type
-
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
-
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. -
toHuman
Return the "human" string form of this instance. This is generally less "debuggy" thantoString()
.- Returns:
non-null;
the human string form
-
getType
Description copied from interface:TypeBearer
Gets the type associated with this instance.- Returns:
non-null;
the type
-