com.android.dx.dex.code
Class PositionList

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

public final class PositionList
extends FixedSizeList

List of source position entries. This class includes a utility method to extract an instance out of a DalvInsnList.


Nested Class Summary
static class PositionList.Entry
          Entry in a position list.
 
Field Summary
static PositionList EMPTY
          non-null; empty instance
static int IMPORTANT
          constant for make(com.android.dx.dex.code.DalvInsnList, int) to indicate that only "important" position information should be returned.
static int LINES
          constant for make(com.android.dx.dex.code.DalvInsnList, int) to indicate that only line number transitions should be returned
static int NONE
          constant for make(com.android.dx.dex.code.DalvInsnList, int) to indicate that no actual position information should be returned
 
Constructor Summary
PositionList(int size)
          Constructs an instance.
 
Method Summary
 PositionList.Entry get(int n)
          Gets the element at the given index.
static PositionList make(DalvInsnList insns, int howMuch)
          Extracts and returns the source position information out of an instruction list.
 void set(int n, PositionList.Entry entry)
          Sets the entry 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 PositionList EMPTY
non-null; empty instance


NONE

public static final int NONE
constant for make(com.android.dx.dex.code.DalvInsnList, int) to indicate that no actual position information should be returned

See Also:
Constant Field Values

LINES

public static final int LINES
constant for make(com.android.dx.dex.code.DalvInsnList, int) to indicate that only line number transitions should be returned

See Also:
Constant Field Values

IMPORTANT

public static final int IMPORTANT
constant for make(com.android.dx.dex.code.DalvInsnList, int) to indicate that only "important" position information should be returned. This includes block starts and instructions that might throw.

See Also:
Constant Field Values
Constructor Detail

PositionList

public PositionList(int size)
Constructs an instance. All indices initially contain null.

Parameters:
size - >= 0; the size of the list
Method Detail

make

public static PositionList make(DalvInsnList insns,
                                int howMuch)
Extracts and returns the source position information out of an instruction list.

Parameters:
insns - non-null; instructions to convert
howMuch - how much information should be included; one of the static constants defined by this class
Returns:
non-null; the positions list

get

public PositionList.Entry 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,
                PositionList.Entry entry)
Sets the entry at the given index.

Parameters:
n - >= 0, < size(); which index
entry - non-null; the entry to set at n


Copyright © 2015. All rights reserved.