Interface TypeList

All Known Implementing Classes:
RegisterSpecList, StdTypeList

public interface TypeList
List of Type instances (or of things that contain types).
  • Method Summary

    Modifier and Type
    Method
    Description
    getType(int n)
    Gets the indicated element.
    int
    Gets the number of 32-bit words required to hold instances of all the elements of this list.
    boolean
    Returns whether this instance is mutable.
    int
    Gets the size of this list.
    Returns a new instance which is identical to this one, except that the given item is appended to the end and it is guaranteed to be immutable.
  • Method Details

    • isMutable

      boolean isMutable()
      Returns whether this instance is mutable. Note that the TypeList interface itself doesn't provide any means of mutation, but that doesn't mean that there isn't an extra-interface way of mutating an instance.
      Returns:
      true if this instance is mutable or false if it is immutable
    • size

      int size()
      Gets the size of this list.
      Returns:
      >= 0; the size
    • getType

      Type getType(int n)
      Gets the indicated element. 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 element
      Returns:
      non-null; the indicated element
    • getWordCount

      int getWordCount()
      Gets the number of 32-bit words required to hold instances of all the elements of this list. This is a sum of the widths (categories) of all the elements.
      Returns:
      >= 0; the required number of words
    • withAddedType

      TypeList withAddedType(Type type)
      Returns a new instance which is identical to this one, except that the given item is appended to the end and it is guaranteed to be immutable.
      Parameters:
      type - non-null; item to append
      Returns:
      non-null; an appropriately-constructed instance