Class LineNumberList

All Implemented Interfaces:
ToHuman

public final class LineNumberList extends FixedSizeList
List of "line number" entries, which are the contents of LineNumberTable attributes.
  • Field Details

    • EMPTY

      public static final LineNumberList EMPTY
      non-null; zero-size instance
  • Constructor Details

    • LineNumberList

      public LineNumberList(int count)
      Constructs an instance.
      Parameters:
      count - the number of elements to be in the list
  • Method Details

    • concat

      public static LineNumberList concat(LineNumberList list1, LineNumberList list2)
      Returns an instance which is the concatenation of the two given instances.
      Parameters:
      list1 - non-null; first instance
      list2 - non-null; second instance
      Returns:
      non-null; combined instance
    • get

      public LineNumberList.Item get(int n)
      Gets the indicated item.
      Parameters:
      n - >= 0; which item
      Returns:
      null-ok; the indicated item
    • set

      public void set(int n, LineNumberList.Item item)
      Sets the item at the given index.
      Parameters:
      n - >= 0, < size(); which element
      item - non-null; the item
    • set

      public void set(int n, int startPc, int lineNumber)
      Sets the item at the given index.
      Parameters:
      n - >= 0, < size(); which element
      startPc - >= 0; start pc of this item
      lineNumber - >= 0; corresponding line number
    • pcToLine

      public int pcToLine(int pc)
      Gets the line number associated with the given address.
      Parameters:
      pc - >= 0; the address to look up
      Returns:
      >= -1; the associated line number, or -1 if none is known