Top Description Fields Constructors Methods
org.droidparts.dexmaker.dx.dex.file

public final Class MapItem

extends OffsettedItem
Class Inheritance
Imports
org.droidparts.dexmaker.dx.util.AnnotatedOutput, .Hex, java.util.ArrayList

Class that represents a map item.

Field Summary

Modifier and TypeField and Description
private static final int
ALIGNMENT

file alignment of this class, in bytes

private final Item
firstItem

null-ok; first item covered or null if this is a self-reference

private final int
itemCount

> 0; count of items covered; 1 if this is a self-reference

private final Item
lastItem

null-ok; last item covered or null if this is a self-reference

private final Section
section

non-null; section this instance covers

private final ItemType
type

non-null; item type this instance covers

private static final int
WRITE_SIZE

write size of this class, in bytes: three uints

Constructor Summary

AccessConstructor and Description
private
MapItem(ItemType
non-null; item type this instance covers
type
,
Section
non-null; section this instance covers
section
,
Item
non-null; first item covered
firstItem
,
Item
non-null; last item covered
lastItem
,
int
> 0; count of items covered
itemCount
)

Constructs an instance.

private
MapItem(Section
non-null; section this instance covers
section
)

Constructs a self-referential instance.

Method Summary

Modifier and TypeMethod and Description
public void
addContents(DexFile
non-null; the file to populate
file
)

Implements abstract org.droidparts.dexmaker.dx.dex.file.Item.addContents.

Populates a DexFile with items from within this instance.
public static void
addMap(Section[]
non-null; the sections
sections
,
MixedItemSection
non-null; the section that the resulting map should be added to; it should be empty on entry to this method
mapSection
)

Constructs a list item with instances of this class representing the contents of the given array of sections, adding it to the given map section.

public ItemType
itemType()

Implements abstract org.droidparts.dexmaker.dx.dex.file.Item.itemType.

Returns the item type for this instance.
public final String
toHuman()

Implements abstract org.droidparts.dexmaker.dx.dex.file.OffsettedItem.toHuman.

Gets a short human-readable string representing this instance.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
protected void
writeTo0(DexFile
non-null; the file to use for reference
file
,
AnnotatedOutput
non-null; where to write to
out
)

Implements abstract org.droidparts.dexmaker.dx.dex.file.OffsettedItem.writeTo0.

Performs the actual write of the contents of this instance to the given data section.
Inherited from org.droidparts.dexmaker.dx.dex.file.OffsettedItem:
compareTocompareTo0equalsgetAbsoluteOffsetgetAbsoluteOffsetOr0getAlignmentgetRelativeOffsetoffsetStringplaceplace0setWriteSizewriteSizewriteTo

Field Detail

ALIGNMENTback to summary
private static final int ALIGNMENT

file alignment of this class, in bytes

firstItemback to summary
private final Item firstItem

null-ok; first item covered or null if this is a self-reference

itemCountback to summary
private final int itemCount

> 0; count of items covered; 1 if this is a self-reference

lastItemback to summary
private final Item lastItem

null-ok; last item covered or null if this is a self-reference

sectionback to summary
private final Section section

non-null; section this instance covers

typeback to summary
private final ItemType type

non-null; item type this instance covers

WRITE_SIZEback to summary
private static final int WRITE_SIZE

write size of this class, in bytes: three uints

Constructor Detail

MapItemback to summary
private MapItem(ItemType type, Section section, Item firstItem, Item lastItem, int itemCount)

Constructs an instance.

Parameters
type:ItemType

non-null; item type this instance covers

section:Section

non-null; section this instance covers

firstItem:Item

non-null; first item covered

lastItem:Item

non-null; last item covered

itemCount:int

> 0; count of items covered

MapItemback to summary
private MapItem(Section section)

Constructs a self-referential instance. This instance is meant to represent the section containing the map_list.

Parameters
section:Section

non-null; section this instance covers

Method Detail

addContentsback to summary
public void addContents(DexFile file)

Implements abstract org.droidparts.dexmaker.dx.dex.file.Item.addContents.

Doc from org.droidparts.dexmaker.dx.dex.file.Item.addContents.

Populates a 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.

Parameters
file:DexFile

non-null; the file to populate

Annotations
@Override
addMapback to summary
public static void addMap(Section[] sections, MixedItemSection mapSection)

Constructs a list item with instances of this class representing the contents of the given array of sections, adding it to the given map section.

Parameters
sections:Section[]

non-null; the sections

mapSection:MixedItemSection

non-null; the section that the resulting map should be added to; it should be empty on entry to this method

itemTypeback to summary
public ItemType itemType()

Implements abstract org.droidparts.dexmaker.dx.dex.file.Item.itemType.

Doc from org.droidparts.dexmaker.dx.dex.file.Item.itemType.

Returns the item type for this instance.

Returns:ItemType

non-null; the item type

Annotations
@Override
toHumanback to summary
public final String toHuman()

Implements abstract org.droidparts.dexmaker.dx.dex.file.OffsettedItem.toHuman.

Doc from org.droidparts.dexmaker.dx.dex.file.OffsettedItem.toHuman.

Gets a short human-readable string representing this instance.

Returns:String

non-null; the human form

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
writeTo0back to summary
protected void writeTo0(DexFile file, AnnotatedOutput out)

Implements abstract org.droidparts.dexmaker.dx.dex.file.OffsettedItem.writeTo0.

Doc from org.droidparts.dexmaker.dx.dex.file.OffsettedItem.writeTo0.

Performs the actual write of the contents of this instance to the given data section. This is called by writeTo, which will have taken care of ensuring alignment.

Parameters
file:DexFile

non-null; the file to use for reference

out:AnnotatedOutput

non-null; where to write to

Annotations
@Override