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

TypeIdItem

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

Fields Summary
Constructors Summary
public TypeIdItem(com.android.dx.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 SizeOf.TYPE_ID_ITEM;
    
public voidwriteTo(DexFile file, com.android.dx.util.AnnotatedOutput out)
{@inheritDoc}

        CstType type = getDefiningClass();
        CstString 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);