FileDocCategorySizeDatePackage
TypeIdItem.javaAPI DocAndroid 5.1 API2094Thu Mar 12 22:18:30 GMT 2015com.android.dexgen.dex.file

TypeIdItem

public final class TypeIdItem extends IdItem
Representation of a type reference inside a Dalvik file.

Fields Summary
public static final int
WRITE_SIZE
size of instances when written out to a file, in bytes
Constructors Summary
public TypeIdItem(com.android.dexgen.rop.cst.CstType type)
Constructs an instance.

param
type {@code non-null;} the constant for the type


                     
       
        super(type);
    
Methods Summary
public voidaddContents(DexFile file)
{@inheritDoc}

        file.getStringIds().intern(getDefiningClass().getDescriptor());
    
public ItemTypeitemType()
{@inheritDoc}

        return ItemType.TYPE_TYPE_ID_ITEM;
    
public intwriteSize()
{@inheritDoc}

        return WRITE_SIZE;
    
public voidwriteTo(DexFile file, com.android.dexgen.util.AnnotatedOutput out)
{@inheritDoc}

        CstType type = getDefiningClass();
        CstUtf8 descriptor = type.getDescriptor();
        int idx = file.getStringIds().indexOf(descriptor);

        if (out.annotates()) {
            out.annotate(0, indexString() + ' " + descriptor.toHuman());
            out.annotate(4, "  descriptor_idx: " + Hex.u4(idx));
        }

        out.writeInt(idx);