Methods Summary |
---|
public abstract IndexedItem | get(com.android.dexgen.rop.cst.Constant cst)Gets the item corresponding to the given {@link Constant}. This
will throw an exception if the constant is not found, including
if this instance isn't the sort that maps constants to {@link
IndexedItem} instances.
|
public final int | getAbsoluteItemOffset(Item item){@inheritDoc}
/*
* Since all items must be the same size, we can use the size
* of the one we're given to calculate its offset.
*/
IndexedItem ii = (IndexedItem) item;
int relativeOffset = ii.getIndex() * ii.writeSize();
return getAbsoluteOffset(relativeOffset);
|
protected abstract void | orderItems()Alters or picks the order for items in this instance if desired,
so that subsequent calls to {@link #items} will yield a
so-ordered collection. If the items in this instance are indexed,
then this method should also assign indices.
|
protected final void | prepare0(){@inheritDoc}
DexFile file = getFile();
orderItems();
for (Item one : items()) {
one.addContents(file);
}
|
public final int | writeSize(){@inheritDoc}
Collection<? extends Item> items = items();
int sz = items.size();
if (sz == 0) {
return 0;
}
// Since each item has to be the same size, we can pick any.
return sz * items.iterator().next().writeSize();
|
protected final void | writeTo0(com.android.dexgen.util.AnnotatedOutput out){@inheritDoc}
DexFile file = getFile();
int alignment = getAlignment();
for (Item one : items()) {
one.writeTo(file, out);
out.alignTo(alignment);
}
|