FileDocCategorySizeDatePackage
AnnotationsList.javaAPI DocAndroid 1.5 API2859Wed May 06 22:41:02 BST 2009com.android.dx.rop.annotation

AnnotationsList

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

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

param
size the size of the list

        super(size);
    
Methods Summary
public static com.android.dx.rop.annotation.AnnotationsListcombine(com.android.dx.rop.annotation.AnnotationsList list1, com.android.dx.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 non-null; an instance
param
list2 non-null; the other instance
return
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 NullPointerException.

param
n >= 0, < size(); which index
return
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 >= 0, < size(); which index
param
a null-ok; the element to set at n

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