Class CstBaseMethodRef
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.CstBaseMethodRef
- All Implemented Interfaces:
TypeBearer, ToHuman, Comparable<Constant>
- Direct Known Subclasses:
CstInterfaceMethodRef, CstMethodRef
Base class for constants of "methodish" type.
Note: As a TypeBearer, this class bears the return type
of the method.
-
Method Summary
Modifier and TypeMethodDescriptionprotected final intcompareTo0(Constant other) Compare the values of this and another instance, which are guaranteed to be of the same class.final intgetParameterWordCount(boolean isStatic) Gets the number of words of parameters required by this method's descriptor.final PrototypeGets the raw prototype of this method.final PrototypegetPrototype(boolean isStatic) Gets the prototype of this method as either astaticor instance method.final TypegetType()Gets the type associated with this instance.final booleanGets whether this is a reference to a class initialization method.final booleanGets whether this is a reference to an instance initialization method.final booleanGet whether this is a reference to a signature polymorphic method.Methods inherited from class CstMemberRef
equals, getDefiningClass, getNat, hashCode, isCategory2, toHuman, toStringMethods inherited from class TypedConstant
getBasicFrameType, getBasicType, getFrameType, isConstant
-
Method Details
-
getPrototype
Gets the raw prototype of this method. This doesn't include athisargument.- Returns:
non-null;the method prototype
-
getPrototype
Gets the prototype of this method as either astaticor instance method. In the case of astaticmethod, this is the same as the raw prototype. In the case of an instance method, this has an appropriately-typedthisargument as the first one.- Parameters:
isStatic- whether the method should be considered static- Returns:
non-null;the method prototype
-
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:
compareTo0in classCstMemberRef- Parameters:
other-non-null;the instance to compare to- Returns:
-1,0, or1, as usual for a comparison
-
getType
Gets the type associated with this instance. In this case, this method returns the return type of this method.- Returns:
non-null;the method's return type
-
getParameterWordCount
public final int getParameterWordCount(boolean isStatic) Gets the number of words of parameters required by this method's descriptor. Since instances of this class have no way to know if they will be used in astaticor instance context, one has to indicate this explicitly as an argument. This method is just a convenient shorthand forgetPrototype().getParameterTypes().getWordCount(), plus1if the method is to be treated as an instance method.- Parameters:
isStatic- whether the method should be considered static- Returns:
>= 0;the argument word count
-
isInstanceInit
public final boolean isInstanceInit()Gets whether this is a reference to an instance initialization method. This is just a convenient shorthand forgetNat().isInstanceInit().- Returns:
trueiff this is a reference to an instance initialization method
-
isClassInit
public final boolean isClassInit()Gets whether this is a reference to a class initialization method. This is just a convenient shorthand forgetNat().isClassInit().- Returns:
trueiff this is a reference to an instance initialization method
-
isSignaturePolymorphic
public final boolean isSignaturePolymorphic()Get whether this is a reference to a signature polymorphic method. This means it is defined injava.lang.invoke.MethodHandleand is either theinvokeor theinvokeExactmethod.- Returns:
trueiff this is a reference to a signature polymorphic method.
-