Class AnnotationsList

All Implemented Interfaces:
ToHuman

public final class AnnotationsList extends FixedSizeList
List of Annotations instances.
  • Field Details

    • EMPTY

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

    • AnnotationsList

      public AnnotationsList(int size)
      Constructs an instance. All indices initially contain null.
      Parameters:
      size - the size of the list
  • Method Details

    • 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