Package com.android.dx.dex.file
Class EncodedField
java.lang.Object
com.android.dx.dex.file.EncodedMember
com.android.dx.dex.file.EncodedField
- All Implemented Interfaces:
ToHuman
,Comparable<EncodedField>
Representation of a field of a class, of any sort.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addContents
(DexFile file) Populates aDexFile
with items from within this instance.int
compareTo
(EncodedField 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
getName()
Gets the name.getRef()
Gets the constant for the field.int
hashCode()
toHuman()
Return the "human" string form of this instance.toString()
Methods inherited from class com.android.dx.dex.file.EncodedMember
getAccessFlags
-
Constructor Details
-
EncodedField
Constructs an instance.- Parameters:
field
-non-null;
constant for the fieldaccessFlags
- access flags
-
-
Method Details
-
hashCode
public int hashCode() -
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<EncodedField>
-
toString
-
addContents
Populates aDexFile
with items from within this instance.- Specified by:
addContents
in classEncodedMember
- Parameters:
file
-non-null;
the file to populate
-
getName
Gets the name.- Specified by:
getName
in classEncodedMember
- Returns:
non-null;
the name
-
toHuman
Return the "human" string form of this instance. This is generally less "debuggy" thantoString()
. -
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 field.- 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
-