| Modifier and Type | Field and Description |
|---|---|
| private Section | addedTo
|
| private final int | alignment
|
| private int | offset
|
| private int | writeSize
|
| Access | Constructor and Description |
|---|---|
| public | OffsettedItem(int
> 0; output alignment requirement; must be a
power of 2>= -1; the size of this instance when written,
in bytes, or -1 if not immediately knownConstructs an instance. |
| Modifier and Type | Method and Description |
|---|---|
| public final int | compareTo(OffsettedItem
the object to be compared. other)Implements java. |
| protected int | Returns: -1, 0, or 1, depending
on the sort order of this instance and the othernon-null; instance to compare toCompares this instance to another which is guaranteed to be of the same class. |
| public final boolean | equals(Object
the reference object with which to compare. other)Overrides java. |
| public final int | |
| public static int | Returns: >= 0; the item's absolute offset, or 0
if item == nullnull-ok; the item in questionGets the absolute offset of the given item, returning |
| public final int | Returns: > 0; the alignment requirement; must be a power of 2Gets the alignment requirement of this instance. |
| public final int | |
| public final String | Returns: non-null; the offset stringGets the absolute offset of this item as a string, suitable for including in annotations. |
| public final int | Returns: >= 0; the offset that this instance should be placed at
in order to meet its alignment constraintnon-null; the section this instance has
been added to>= 0; the desired offset from the start of the
section where this instance was placedIndicates that this item has been added to the given section at the given offset. |
| protected void | |
| public final void | |
| public abstract String | Returns: non-null; the human formGets a short human-readable string representing this instance. |
| public final int | writeSize()
Implements abstract org. |
| public final void | writeTo(DexFile
non-null; the file to use for referencenon-null; where to write toImplements abstract org. DexFile to look things up as needed.
|
| protected abstract void | writeTo0(DexFile
non-null; the file to use for referencenon-null; where to write toPerforms the actual write of the contents of this instance to the given data section. |
| addedTo | back to summary |
|---|---|
| private Section addedTo
| |
| alignment | back to summary |
|---|---|
| private final int alignment
| |
| offset | back to summary |
|---|---|
| private int offset
| |
| writeSize | back to summary |
|---|---|
| private int writeSize
| |
| OffsettedItem | back to summary |
|---|---|
| public OffsettedItem(int alignment, int writeSize) Constructs an instance. The offset is initially unassigned.
| |
| compareTo | back to summary |
|---|---|
| public final int compareTo(OffsettedItem other) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| compareTo0 | back to summary |
|---|---|
| protected int compareTo0(OffsettedItem other) Compares this instance to another which is guaranteed to be of the same class. The default implementation of this method is to throw an exception (unsupported operation). If a particular class needs to actually sort, then it should override this method.
| |
| equals | back to summary |
|---|---|
| public final boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on
into equivalence classes; all the members of an
equivalence class are equal to each other. Members of an
equivalence class are substitutable for each other, at least
for some purposes.
Comparisons for this class are defined to be type-major (if the
types don't match then the objects are not equal), with
| |
| getAbsoluteOffset | back to summary |
|---|---|
| public final int getAbsoluteOffset() Gets the absolute item offset. The offset is from the start of the file which the instance was written to.
| |
| getAbsoluteOffsetOr0 | back to summary |
|---|---|
| public static int getAbsoluteOffsetOr0(OffsettedItem item) Gets the absolute offset of the given item, returning
| |
| getAlignment | back to summary |
|---|---|
| public final int getAlignment() Gets the alignment requirement of this instance. An instance should only be written when so aligned.
| |
| getRelativeOffset | back to summary |
|---|---|
| public final int getRelativeOffset() Gets the relative item offset. The offset is from the start of the section which the instance was written to.
| |
| offsetString | back to summary |
|---|---|
| public final String offsetString() Gets the absolute offset of this item as a string, suitable for including in annotations.
| |
| place | back to summary |
|---|---|
| public final int place(Section addedTo, int offset) Indicates that this item has been added to the given section at the given offset. It is only valid to call this method once per instance.
| |
| place0 | back to summary |
|---|---|
| protected void place0(Section addedTo, int offset) Does additional work required when placing an instance. The default implementation of this method is a no-op. If a particular class needs to do something special, then it should override this method. In particular, if this instance did not know its write size up-front, then this method is responsible for setting it.
| |
| setWriteSize | back to summary |
|---|---|
| public final void setWriteSize(int writeSize) Sets the write size of this item. This may only be called once per instance, and only if the size was unknown upon instance creation.
| |
| toHuman | back to summary |
|---|---|
| public abstract String toHuman() Gets a short human-readable string representing this instance.
| |
| writeSize | back to summary |
|---|---|
| public final int writeSize() Implements abstract org. Doc from org. Gets the size of this instance when written, in bytes.
| |
| writeTo | back to summary |
|---|---|
| public final void writeTo(DexFile file, AnnotatedOutput out) Implements abstract org. Doc from org. Writes the representation of this instance to the given data section,
using the given
| |
| writeTo0 | back to summary |
|---|---|
| protected abstract void writeTo0(DexFile file, AnnotatedOutput out) Performs the actual write of the contents of this instance to
the given data section. This is called by
| |