com.android.dx.cf.code
Class LineNumberList

java.lang.Object
  extended by com.android.dx.util.MutabilityControl
      extended by com.android.dx.util.FixedSizeList
          extended by com.android.dx.cf.code.LineNumberList
All Implemented Interfaces:
ToHuman

public final class LineNumberList
extends FixedSizeList

List of "line number" entries, which are the contents of LineNumberTable attributes.


Nested Class Summary
static class LineNumberList.Item
          Item in a line number table.
 
Field Summary
static LineNumberList EMPTY
          non-null; zero-size instance
 
Constructor Summary
LineNumberList(int count)
          Constructs an instance.
 
Method Summary
static LineNumberList concat(LineNumberList list1, LineNumberList list2)
          Returns an instance which is the concatenation of the two given instances.
 LineNumberList.Item get(int n)
          Gets the indicated item.
 int pcToLine(int pc)
          Gets the line number associated with the given address.
 void set(int n, int startPc, int lineNumber)
          Sets the item at the given index.
 void set(int n, LineNumberList.Item item)
          Sets the item 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 LineNumberList EMPTY
non-null; zero-size instance

Constructor Detail

LineNumberList

public LineNumberList(int count)
Constructs an instance.

Parameters:
count - the number of elements to be in the list
Method Detail

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


Copyright © 2015. All rights reserved.