Methods Summary |
---|
public IndexedItem | get(com.android.dx.rop.cst.Constant cst){@inheritDoc}
throw new UnsupportedOperationException("unsupported");
|
public int | indexOf(com.android.dx.rop.type.Prototype prototype)Gets the index of the given prototype, which must have
been added to this instance.
if (prototype == null) {
throw new NullPointerException("prototype == null");
}
throwIfNotPrepared();
ProtoIdItem item = protoIds.get(prototype);
if (item == null) {
throw new IllegalArgumentException("not found");
}
return item.getIndex();
|
public ProtoIdItem | intern(com.android.dx.rop.type.Prototype prototype)Interns an element into this instance.
if (prototype == null) {
throw new NullPointerException("prototype == null");
}
throwIfPrepared();
ProtoIdItem result = protoIds.get(prototype);
if (result == null) {
result = new ProtoIdItem(prototype);
protoIds.put(prototype, result);
}
return result;
|
public java.util.Collection | items(){@inheritDoc}
return protoIds.values();
|
protected void | orderItems(){@inheritDoc}
int idx = 0;
for (Object i : items()) {
((ProtoIdItem) i).setIndex(idx);
idx++;
}
|
public void | writeHeaderPart(com.android.dx.util.AnnotatedOutput out)Writes the portion of the file header that refers to this instance.
throwIfNotPrepared();
int sz = protoIds.size();
int offset = (sz == 0) ? 0 : getFileOffset();
if (sz > 65536) {
throw new UnsupportedOperationException("too many proto ids");
}
if (out.annotates()) {
out.annotate(4, "proto_ids_size: " + Hex.u4(sz));
out.annotate(4, "proto_ids_off: " + Hex.u4(offset));
}
out.writeInt(sz);
out.writeInt(offset);
|