FileDocCategorySizeDatePackage
AnnotationSetRefItem.javaAPI DocAndroid 5.1 API2331Thu Mar 12 22:18:30 GMT 2015com.android.dexgen.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
{@code non-null;} the annotation set to refer to
Constructors Summary
public AnnotationSetRefItem(AnnotationSetItem annotations)
Constructs an instance.

param
annotations {@code 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.dexgen.util.AnnotatedOutput out)
{@inheritDoc}

        int annotationsOff = annotations.getAbsoluteOffset();

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

        out.writeInt(annotationsOff);