Top Description Fields Constructors Methods
org.droidparts.dexmaker.dx.rop.cst

public abstract Class CstBaseMethodRef

extends CstMemberRef
Class Inheritance
Known Direct Subclasses
org.droidparts.dexmaker.dx.rop.cst.CstInterfaceMethodRef, org.droidparts.dexmaker.dx.rop.cst.CstMethodRef
Imports
org.droidparts.dexmaker.dx.rop.type.Prototype, .Type, .TypeBearer

Base class for constants of "methodish" type.

Note

As a TypeBearer, this class bears the return type of the method.

Field Summary

Modifier and TypeField and Description
private Prototype
instancePrototype

null-ok; the prototype for this method taken to be an instance method, or null if not yet calculated

private final Prototype
prototype

non-null; the raw prototype for this method

Constructor Summary

AccessConstructor and Description
pack-priv
CstBaseMethodRef(CstType
non-null; the type of the defining class
definingClass
,
CstNat
non-null; the name-and-type
nat
)

Constructs an instance.

Method Summary

Modifier and TypeMethod and Description
protected final int
compareTo0(Constant
non-null; the instance to compare to
other
)

Overrides org.droidparts.dexmaker.dx.rop.cst.CstMemberRef.compareTo0.

Compare the values of this and another instance, which are guaranteed to be of the same class.
public final int

Returns:

>= 0; the argument word count
getParameterWordCount
(boolean
whether the method should be considered static
isStatic
)

Gets the number of words of parameters required by this method's descriptor.

public final Prototype

Returns:

non-null; the method prototype
getPrototype
()

Gets the raw prototype of this method.

public final Prototype

Returns:

non-null; the method prototype
getPrototype
(boolean
whether the method should be considered static
isStatic
)

Gets the prototype of this method as either a static or instance method.

public final Type

Returns:

non-null; the method's return type
getType
()

Implements org.droidparts.dexmaker.dx.rop.type.TypeBearer.getType.

Gets the type associated with this instance.
public final boolean

Returns:

true iff this is a reference to an instance initialization method
isClassInit
()

Gets whether this is a reference to a class initialization method.

public final boolean

Returns:

true iff this is a reference to an instance initialization method
isInstanceInit
()

Gets whether this is a reference to an instance initialization method.

Inherited from org.droidparts.dexmaker.dx.rop.cst.CstMemberRef:
equalsgetDefiningClassgetNathashCodeisCategory2toHumantoString

Field Detail

instancePrototypeback to summary
private Prototype instancePrototype

null-ok; the prototype for this method taken to be an instance method, or null if not yet calculated

prototypeback to summary
private final Prototype prototype

non-null; the raw prototype for this method

Constructor Detail

CstBaseMethodRefback to summary
pack-priv CstBaseMethodRef(CstType definingClass, CstNat nat)

Constructs an instance.

Parameters
definingClass:CstType

non-null; the type of the defining class

nat:CstNat

non-null; the name-and-type

Method Detail

compareTo0back to summary
protected final int compareTo0(Constant other)

Overrides org.droidparts.dexmaker.dx.rop.cst.CstMemberRef.compareTo0.

Doc from org.droidparts.dexmaker.dx.rop.cst.CstMemberRef.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().

Parameters
other:Constant

Doc from org.droidparts.dexmaker.dx.rop.cst.Constant.compareTo0.

non-null; the instance to compare to

Returns:int

Doc from org.droidparts.dexmaker.dx.rop.cst.Constant.compareTo0.

-1, 0, or 1, as usual for a comparison

Annotations
@Override
getParameterWordCountback to summary
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 a static or instance context, one has to indicate this explicitly as an argument. This method is just a convenient shorthand for getPrototype().getParameterTypes().getWordCount(), plus 1 if the method is to be treated as an instance method.

Parameters
isStatic:boolean

whether the method should be considered static

Returns:int

>= 0; the argument word count

getPrototypeback to summary
public final Prototype getPrototype()

Gets the raw prototype of this method. This doesn't include a this argument.

Returns:Prototype

non-null; the method prototype

getPrototypeback to summary
public final Prototype getPrototype(boolean isStatic)

Gets the prototype of this method as either a static or instance method. In the case of a static method, this is the same as the raw prototype. In the case of an instance method, this has an appropriately-typed this argument as the first one.

Parameters
isStatic:boolean

whether the method should be considered static

Returns:Prototype

non-null; the method prototype

getTypeback to summary
public final Type getType()

Implements org.droidparts.dexmaker.dx.rop.type.TypeBearer.getType.

Doc from org.droidparts.dexmaker.dx.rop.type.TypeBearer.getType.

Gets the type associated with this instance. In this case, this method returns the return type of this method.

Returns:Type

non-null; the method's return type

isClassInitback to summary
public final boolean isClassInit()

Gets whether this is a reference to a class initialization method. This is just a convenient shorthand for getNat().isClassInit().

Returns:boolean

true iff this is a reference to an instance initialization method

isInstanceInitback to summary
public final boolean isInstanceInit()

Gets whether this is a reference to an instance initialization method. This is just a convenient shorthand for getNat().isInstanceInit().

Returns:boolean

true iff this is a reference to an instance initialization method