com.android.dx.rop.annotation
Class AnnotationsList

java.lang.Object
  extended by com.android.dx.util.MutabilityControl
      extended by com.android.dx.util.FixedSizeList
          extended by com.android.dx.rop.annotation.AnnotationsList
All Implemented Interfaces:
ToHuman

public final class AnnotationsList
extends FixedSizeList

List of Annotations instances.


Field Summary
static AnnotationsList EMPTY
          non-null; immutable empty instance
 
Constructor Summary
AnnotationsList(int size)
          Constructs an instance.
 
Method Summary
static AnnotationsList combine(AnnotationsList list1, AnnotationsList list2)
          Constructs an immutable instance which is the combination of the two given instances.
 Annotations get(int n)
          Gets the element at the given index.
 void set(int n, Annotations a)
          Sets the element at the given index.
 
Methods inherited from class com.android.dx.util.FixedSizeList
equals, get0, getOrNull0, hashCode, set0, shrinkToFit, size, toHuman, toHuman, toString, toString
 
Methods inherited from class com.android.dx.util.MutabilityControl
isImmutable, isMutable, setImmutable, throwIfImmutable, throwIfMutable
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY

public static final AnnotationsList EMPTY
non-null; immutable empty instance

Constructor Detail

AnnotationsList

public AnnotationsList(int size)
Constructs an instance. All indices initially contain null.

Parameters:
size - the size of the list
Method Detail

combine

public static AnnotationsList combine(AnnotationsList list1,
                                      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.

Parameters:
list1 - non-null; an instance
list2 - non-null; the other instance
Returns:
non-null; the combination

get

public Annotations get(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.

Parameters:
n - >= 0, < size(); which index
Returns:
non-null; element at that index

set

public void set(int n,
                Annotations a)
Sets the element at the given index. The given element must be immutable.

Parameters:
n - >= 0, < size(); which index
a - null-ok; the element to set at n


Copyright © 2013. All Rights Reserved.