.dex file which consists of a sequence of
OffsettedItem objects, which may each be of a different concrete
class and/or sizeNote
It is invalid for an item in an instance of this class to have a larger alignment requirement than the alignment of this instance.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static enum |
| Modifier and Type | Field and Description |
|---|---|
| private final HashMap | interns
|
| private final ArrayList | items
|
| private final MixedItemSection. | sort
|
| private static final Comparator | TYPE_SORTER
|
| private int | writeSize
|
| Access | Constructor and Description |
|---|---|
| public | MixedItemSection(String
null-ok; the name of this instance, for annotation
purposesnon-null; file that this instance is part of> 0; alignment requirement for the final output;
must be a power of 2how the items should be sorted in the final output sortConstructs an instance. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public <T extends OffsettedItem> T | Returns: non-null; the equivalent already-interned instancenon-null; the item to look forGets an item which was previously interned. |
| public int | getAbsoluteItemOffset(Item
non-null; the item in questionImplements abstract org. |
| public <T extends OffsettedItem> T | Returns: non-null; the equivalent interned instancenon-null; the item to internInterns an item in this instance, returning the interned instance (which may not be the one passed in). |
| public Collection | items()
Implements abstract org. |
| public void | |
| protected void | prepare0()
Implements abstract org. prepare.
|
| public int | |
| public void | writeHeaderPart(AnnotatedOutput
non-null; where to writeWrites the portion of the file header that refers to this instance. |
| public void | writeIndexAnnotation(AnnotatedOutput
non-null; where to write tonon-null; the item type of interestnon-null; the introductory string for non-empty indicesWrites an index of contents of the items in this instance of the given type. |
| public int | writeSize()
Implements abstract org. |
| protected void | writeTo0(AnnotatedOutput
non-null; where to write toImplements abstract org. |
| interns | back to summary |
|---|---|
| private final HashMap<OffsettedItem, OffsettedItem> interns
| |
| items | back to summary |
|---|---|
| private final ArrayList<OffsettedItem> items
| |
| sort | back to summary |
|---|---|
| private final MixedItemSection.
| |
| TYPE_SORTER | back to summary |
|---|---|
| private static final Comparator<OffsettedItem> TYPE_SORTER
| |
| writeSize | back to summary |
|---|---|
| private int writeSize
| |
| MixedItemSection | back to summary |
|---|---|
| public MixedItemSection(String name, DexFile file, int alignment, MixedItemSection. Constructs an instance. The file offset is initially unknown.
| |
| add | back to summary |
|---|---|
| public void add(OffsettedItem item) Adds an item to this instance. This will in turn tell the given item that it has been added to this instance. It is invalid to add the same item to more than one instance, nor to add the same items multiple times to a single instance.
| |
| get | back to summary |
|---|---|
| public <T extends OffsettedItem> T get(T item) Gets an item which was previously interned.
| |
| getAbsoluteItemOffset | back to summary |
|---|---|
| public int getAbsoluteItemOffset(Item item) Implements abstract org. Doc from org. Returns the absolute file offset of the given item which must
be contained in this section. This is only valid to call
once this instance has been assigned a file offset (via Note Subclasses must implement this as appropriate for their contents. | |
| intern | back to summary |
|---|---|
| public <T extends OffsettedItem> T intern(T item) Interns an item in this instance, returning the interned instance (which may not be the one passed in). This will add the item if no equal item has been added.
| |
| items | back to summary |
|---|---|
| public Collection Implements abstract org. Doc from org. Gets the collection of all the items in this section. It is not valid to attempt to change the returned list.
| |
| placeItems | back to summary |
|---|---|
| public void placeItems() Places all the items in this instance at particular offsets. This
will call | |
| prepare0 | back to summary |
|---|---|
| protected void prepare0() Implements abstract org. Doc from org. Does the main work of
| |
| size | back to summary |
|---|---|
| public int size() Gets the size of this instance, in items.
| |
| writeHeaderPart | back to summary |
|---|---|
| public void writeHeaderPart(AnnotatedOutput out) Writes the portion of the file header that refers to this instance.
| |
| writeIndexAnnotation | back to summary |
|---|---|
| public void writeIndexAnnotation(AnnotatedOutput out, ItemType itemType, String intro) Writes an index of contents of the items in this instance of the given type. If there are none, this writes nothing. If there are any, then the index is preceded by the given intro string.
| |
| writeSize | back to summary |
|---|---|
| public int writeSize() Implements abstract org. Doc from org. Gets the size of this instance when output, in bytes.
| |
| writeTo0 | back to summary |
|---|---|
| protected void writeTo0(AnnotatedOutput out) Implements abstract org. Doc from org. Writes this instance to the given raw data object. This gets
called by
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final MixedItemSection. | INSTANCE
sort in class-major order, with instances sorted per-class |
| public static final MixedItemSection. | NONE
no sorting |
| public static final MixedItemSection. | TYPE
sort by type only |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static MixedItemSection. | |
| public static MixedItemSection. |
| INSTANCE | back to summary |
|---|---|
| public static final MixedItemSection. sort in class-major order, with instances sorted per-class | |
| NONE | back to summary |
|---|---|
| public static final MixedItemSection. no sorting | |
| TYPE | back to summary |
|---|---|
| public static final MixedItemSection. sort by type only | |
| SortType | back to summary |
|---|---|
| private SortType() | |
| valueOf | back to summary |
|---|---|
| public static MixedItemSection. | |
| values | back to summary |
|---|---|
| public static MixedItemSection. | |