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