/** * Gets the index of the given type, which must have * been added to this instance. * * @param type {@code non-null;} the type to look up * @return {@code >= 0;} the reference's index */ public int indexOf(CstType type) { if (type == null) { throw new NullPointerException("type == null"); } return indexOf(type.getClassType()); }
/** * Gets the index of the given type, which must have * been added to this instance. * * @param type {@code non-null;} the type to look up * @return {@code >= 0;} the reference's index */ public int indexOf(CstType type) { if (type == null) { throw new NullPointerException("type == null"); } return indexOf(type.getClassType()); }
/** * Gets the index of the given type, which must have * been added to this instance. * * @param type {@code non-null;} the type to look up * @return {@code >= 0;} the reference's index */ public int indexOf(CstType type) { if (type == null) { throw new NullPointerException("type == null"); } return indexOf(type.getClassType()); }
/** * Gets the index of the given type, which must have * been added to this instance. * * @param type {@code non-null;} the type to look up * @return {@code >= 0;} the reference's index */ public int indexOf(CstType type) { if (type == null) { throw new NullPointerException("type == null"); } return indexOf(type.getClassType()); }
/** * Gets the index of the given type, which must have * been added to this instance. * * @param type {@code non-null;} the type to look up * @return {@code >= 0;} the reference's index */ public int indexOf(CstType type) { if (type == null) { throw new NullPointerException("type == null"); } return indexOf(type.getClassType()); }
/** * Gets the index of the given type, which must have * been added to this instance. * * @param type {@code non-null;} the type to look up * @return {@code >= 0;} the reference's index */ public int indexOf(CstType type) { if (type == null) { throw new NullPointerException("type == null"); } return indexOf(type.getClassType()); }
/** * Gets the index of the given type, which must have * been added to this instance. * * @param type {@code non-null;} the type to look up * @return {@code >= 0;} the reference's index */ public int indexOf(CstType type) { if (type == null) { throw new NullPointerException("type == null"); } return indexOf(type.getClassType()); }
/** * Gets the index of the given type, which must have * been added to this instance. * * @param type {@code non-null;} the type to look up * @return {@code >= 0;} the reference's index */ public int indexOf(CstType type) { if (type == null) { throw new NullPointerException("type == null"); } return indexOf(type.getClassType()); }
/** {@inheritDoc} */ @Override protected int getTypoidIdx(DexFile file) { TypeIdsSection typeIds = file.getTypeIds(); return typeIds.indexOf(getFieldRef().getType()); }
/** {@inheritDoc} */ @Override protected int getTypoidIdx(DexFile file) { TypeIdsSection typeIds = file.getTypeIds(); return typeIds.indexOf(getFieldRef().getType()); }
/** {@inheritDoc} */ @Override protected int getTypoidIdx(DexFile file) { TypeIdsSection typeIds = file.getTypeIds(); return typeIds.indexOf(getFieldRef().getType()); }
/** {@inheritDoc} */ @Override protected int getTypoidIdx(DexFile file) { TypeIdsSection typeIds = file.getTypeIds(); return typeIds.indexOf(getFieldRef().getType()); }
/** {@inheritDoc} */ @Override protected int getTypoidIdx(DexFile file) { TypeIdsSection typeIds = file.getTypeIds(); return typeIds.indexOf(getFieldRef().getType()); }
/** {@inheritDoc} */ @Override protected int getTypoidIdx(DexFile file) { TypeIdsSection typeIds = file.getTypeIds(); return typeIds.indexOf(getFieldRef().getType()); }
/** {@inheritDoc} */ @Override protected int getTypoidIdx(DexFile file) { TypeIdsSection typeIds = file.getTypeIds(); return typeIds.indexOf(getFieldRef().getType()); }
/** {@inheritDoc} */ @Override protected int getTypoidIdx(DexFile file) { TypeIdsSection typeIds = file.getTypeIds(); return typeIds.indexOf(getFieldRef().getType()); }
/** * Emits a type index as an unsigned LEB128. The actual value written * is shifted by 1, so that the '0' value is reserved for "null". * * @param type {@code null-ok;} type to emit * @throws IOException */ private void emitTypeIndex(CstType type) throws IOException { if ((type == null) || (file == null)) { output.writeUleb128(0); } else { output.writeUleb128( 1 + file.getTypeIds().indexOf(type)); } if (DEBUG) { System.err.printf("Emit type %s\n", type == null ? "<null>" : type.toHuman()); } }
/** * Emits a type index as an unsigned LEB128. The actual value written * is shifted by 1, so that the '0' value is reserved for "null". * * @param type {@code null-ok;} type to emit * @throws IOException */ private void emitTypeIndex(CstType type) throws IOException { if ((type == null) || (file == null)) { output.writeUleb128(0); } else { output.writeUleb128( 1 + file.getTypeIds().indexOf(type)); } if (DEBUG) { System.err.printf("Emit type %s\n", type == null ? "<null>" : type.toHuman()); } }
/** {@inheritDoc} */ @Override protected void writeTo0(DexFile file, AnnotatedOutput out) { TypeIdsSection typeIds = file.getTypeIds(); int sz = list.size(); if (out.annotates()) { out.annotate(0, offsetString() + " type_list"); out.annotate(HEADER_SIZE, " size: " + Hex.u4(sz)); for (int i = 0; i < sz; i++) { Type one = list.getType(i); int idx = typeIds.indexOf(one); out.annotate(ELEMENT_SIZE, " " + Hex.u2(idx) + " // " + one.toHuman()); } } out.writeInt(sz); for (int i = 0; i < sz; i++) { out.writeShort(typeIds.indexOf(list.getType(i))); } }
/** {@inheritDoc} */ @Override public final void writeTo(DexFile file, AnnotatedOutput out) { TypeIdsSection typeIds = file.getTypeIds(); StringIdsSection stringIds = file.getStringIds(); CstNat nat = cst.getNat(); int classIdx = typeIds.indexOf(getDefiningClass()); int nameIdx = stringIds.indexOf(nat.getName()); int typoidIdx = getTypoidIdx(file); if (out.annotates()) { out.annotate(0, indexString() + ' ' + cst.toHuman()); out.annotate(2, " class_idx: " + Hex.u2(classIdx)); out.annotate(2, String.format(" %-10s %s", getTypoidName() + ':', Hex.u2(typoidIdx))); out.annotate(4, " name_idx: " + Hex.u4(nameIdx)); } out.writeShort(classIdx); out.writeShort(typoidIdx); out.writeInt(nameIdx); }