FileDocCategorySizeDatePackage
AnnotationSetRefItem.javaAPI DocAndroid 1.5 API2304Wed May 06 22:41:02 BST 2009com.android.dx.dex.file

AnnotationSetRefItem

public final class AnnotationSetRefItem extends OffsettedItem
Indirect reference to an {@link AnnotationSetItem}.

Fields Summary
private static final int
ALIGNMENT
the required alignment for instances of this class
private static final int
WRITE_SIZE
write size of this class, in bytes
private AnnotationSetItem
annotations
non-null; the annotation set to refer to
Constructors Summary
public AnnotationSetRefItem(AnnotationSetItem annotations)
Constructs an instance.

param
annotations non-null; the annotation set to refer to


                      
       
        super(ALIGNMENT, WRITE_SIZE);

        if (annotations == null) {
            throw new NullPointerException("annotations == null");
        }

        this.annotations = annotations;
    
Methods Summary
public voidaddContents(DexFile file)
{@inheritDoc}

        MixedItemSection wordData = file.getWordData();

        annotations = wordData.intern(annotations);
    
public ItemTypeitemType()
{@inheritDoc}

        return ItemType.TYPE_ANNOTATION_SET_REF_ITEM;
    
public java.lang.StringtoHuman()
{@inheritDoc}

        return annotations.toHuman();
    
protected voidwriteTo0(DexFile file, com.android.dx.util.AnnotatedOutput out)
{@inheritDoc}

        int annotationsOff = annotations.getAbsoluteOffset();

        if (out.annotates()) {
            out.annotate(4, "  annotations_off: " + Hex.u4(annotationsOff));
        }

        out.writeInt(annotationsOff);