Class Item
java.lang.Object
com.android.dx.dex.file.Item
- Direct Known Subclasses:
IndexedItem, OffsettedItem
Base class for any structurally-significant and (potentially)
repeated piece of a Dalvik file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidaddContents(DexFile file) Populates aDexFilewith items from within this instance.abstract ItemTypeitemType()Returns the item type for this instance.final StringtypeName()Returns the human name for the particular type of item this instance is.abstract intGets the size of this instance when written, in bytes.abstract voidwriteTo(DexFile file, AnnotatedOutput out) Writes the representation of this instance to the given data section, using the givenDexFileto look things up as needed.
-
Constructor Details
-
Item
public Item()Constructs an instance.
-
-
Method Details
-
itemType
Returns the item type for this instance.- Returns:
non-null;the item type
-
typeName
Returns the human name for the particular type of item this instance is.- Returns:
non-null;the name
-
writeSize
public abstract int writeSize()Gets the size of this instance when written, in bytes.- Returns:
>= 0;the write size
-
addContents
Populates aDexFilewith items from within this instance. This will not add an item to the file for this instance itself (which should have been done by whatever refers to this instance).Note: Subclasses must override this to do something appropriate.
- Parameters:
file-non-null;the file to populate
-
writeTo
Writes the representation of this instance to the given data section, using the givenDexFileto look things up as needed. If this instance keeps track of its offset, then this method will note the written offset and will also throw an exception if this instance has already been written.- Parameters:
file-non-null;the file to use for referenceout-non-null;where to write to
-