FileDocCategorySizeDatePackage
TypeIdItem.javaAPI DocAndroid 1.5 API2067Wed May 06 22:41:02 BST 2009com.android.dx.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.dx.rop.cst.CstType type)
Constructs an instance.

param
type 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.dx.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);