Package com.android.dx.dex.file
Class EncodedMethod
java.lang.Object
com.android.dx.dex.file.EncodedMember
com.android.dx.dex.file.EncodedMethod
- All Implemented Interfaces:
ToHuman
,Comparable<EncodedMethod>
Class that representats a method of a class.
-
Constructor Summary
ConstructorDescriptionEncodedMethod
(CstMethodRef method, int accessFlags, DalvCode code, TypeList throwsList) Constructs an instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addContents
(DexFile file) Populates aDexFile
with items from within this instance.int
compareTo
(EncodedMethod other) void
debugPrint
(PrintWriter out, boolean verbose) Does a human-friendly dump of this instance.int
encode
(DexFile file, AnnotatedOutput out, int lastIndex, int dumpSeq) Encodes this instance to the given output.boolean
final CstString
getName()
Gets the name.final CstMethodRef
getRef()
Gets the constant for the method.final String
toHuman()
Return the "human" string form of this instance.toString()
Methods inherited from class com.android.dx.dex.file.EncodedMember
getAccessFlags
-
Constructor Details
-
EncodedMethod
Constructs an instance.- Parameters:
method
-non-null;
constant for the methodaccessFlags
- access flagscode
-null-ok;
code for the method, if it is neitherabstract
nornative
throwsList
-non-null;
list of possibly-thrown exceptions, just used in generating debugging output (listings)
-
-
Method Details
-
equals
-
compareTo
Note: This compares the method constants only, ignoring any associated code, because it should never be the case that two different items with the same method constant ever appear in the same list (or same file, even).
- Specified by:
compareTo
in interfaceComparable<EncodedMethod>
-
toString
-
addContents
Populates aDexFile
with items from within this instance.- Specified by:
addContents
in classEncodedMember
- Parameters:
file
-non-null;
the file to populate
-
toHuman
Return the "human" string form of this instance. This is generally less "debuggy" thantoString()
. -
getName
Gets the name.- Specified by:
getName
in classEncodedMember
- Returns:
non-null;
the name
-
debugPrint
Does a human-friendly dump of this instance.- Specified by:
debugPrint
in classEncodedMember
- Parameters:
out
-non-null;
where to dumpverbose
- whether to be verbose with the output
-
getRef
Gets the constant for the method.- Returns:
non-null;
the constant
-
encode
Encodes this instance to the given output.- Specified by:
encode
in classEncodedMember
- Parameters:
file
-non-null;
file this instance is part ofout
-non-null;
where to write tolastIndex
->= 0;
the previous member index value encoded, or0
if this is the first element to encodedumpSeq
->= 0;
sequence number of this instance for annotation purposes- Returns:
>= 0;
the member index value that was encoded
-