FileDocCategorySizeDatePackage
Item.javaAPI DocAndroid 5.1 API2525Thu Mar 12 22:18:30 GMT 2015com.android.dx.dex.file

Item

public abstract class Item extends Object
Base class for any structurally-significant and (potentially) repeated piece of a Dalvik file.

Fields Summary
Constructors Summary
public Item()
Constructs an instance.

        // This space intentionally left blank.
    
Methods Summary
public abstract voidaddContents(DexFile file)
Populates a {@link DexFile} with 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.

param
file {@code non-null;} the file to populate

public abstract ItemTypeitemType()
Returns the item type for this instance.

return
{@code non-null;} the item type

public final java.lang.StringtypeName()
Returns the human name for the particular type of item this instance is.

return
{@code non-null;} the name

        return itemType().toHuman();
    
public abstract intwriteSize()
Gets the size of this instance when written, in bytes.

return
{@code >= 0;} the write size

public abstract voidwriteTo(DexFile file, com.android.dx.util.AnnotatedOutput out)
Writes the representation of this instance to the given data section, using the given {@link DexFile} to 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.

param
file {@code non-null;} the file to use for reference
param
out {@code non-null;} where to write to