Class CstArray.List

All Implemented Interfaces:
ToHuman, Comparable<CstArray.List>
Enclosing class:
CstArray

public static final class CstArray.List extends FixedSizeList implements Comparable<CstArray.List>
List of Constant instances.
  • Constructor Details

    • List

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

    • compareTo

      public int compareTo(CstArray.List other)
      Specified by:
      compareTo in interface Comparable<CstArray.List>
    • get

      public Constant 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, Constant a)
      Sets the element at the given index.
      Parameters:
      n - >= 0, < size(); which index
      a - null-ok; the element to set at n