FileDocCategorySizeDatePackage
AnnotationsList.javaAPI DocAndroid 5.1 API2896Thu Mar 12 22:18:30 GMT 2015com.android.dexgen.rop.annotation

AnnotationsList

public final class AnnotationsList extends com.android.dexgen.util.FixedSizeList
List of {@link Annotations} instances.

Fields Summary
public static final AnnotationsList
EMPTY
{@code non-null;} immutable empty instance
Constructors Summary
public AnnotationsList(int size)
Constructs an instance. All indices initially contain {@code null}.

param
size the size of the list

        super(size);
    
Methods Summary
public static com.android.dexgen.rop.annotation.AnnotationsListcombine(com.android.dexgen.rop.annotation.AnnotationsList list1, com.android.dexgen.rop.annotation.AnnotationsList list2)
Constructs an immutable instance which is the combination of the two given instances. The two instances must each have the same number of elements, and each pair of elements must contain disjoint sets of types.

param
list1 {@code non-null;} an instance
param
list2 {@code non-null;} the other instance
return
{@code non-null;} the combination


                                                              
        
              
        int size = list1.size();

        if (size != list2.size()) {
            throw new IllegalArgumentException("list1.size() != list2.size()");
        }

        AnnotationsList result = new AnnotationsList(size);

        for (int i = 0; i < size; i++) {
            Annotations a1 = list1.get(i);
            Annotations a2 = list2.get(i);
            result.set(i, Annotations.combine(a1, a2));
        }

        result.setImmutable();
        return result;
    
public Annotationsget(int n)
Gets the element at the given index. It is an error to call this with the index for an element which was never set; if you do that, this will throw {@code NullPointerException}.

param
n {@code >= 0, < size();} which index
return
{@code non-null;} element at that index

        return (Annotations) get0(n);
    
public voidset(int n, Annotations a)
Sets the element at the given index. The given element must be immutable.

param
n {@code >= 0, < size();} which index
param
a {@code null-ok;} the element to set at {@code n}

        a.throwIfMutable();
        set0(n, a);