Top Description Inners Fields Constructors Methods
org.droidparts.dexmaker.dx.dex.code

public final Class PositionList

extends FixedSizeList
Class Inheritance
Imports
org.droidparts.dexmaker.dx.rop.code.SourcePosition, org.droidparts.dexmaker.dx.util.FixedSizeList

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
PositionList.Entry

Entry in a position list.

Field Summary

Modifier and TypeField and Description
public static final PositionList
EMPTY

non-null; empty instance

public static final int
IMPORTANT

constant for make to indicate that only "important" position information should be returned.

public static final int
LINES

constant for make to indicate that only line number transitions should be returned

public static final int
NONE

constant for make to indicate that no actual position information should be returned

Constructor Summary

AccessConstructor and Description
public
PositionList(int
>= 0; the size of the list
size
)

Constructs an instance.

Method Summary

Modifier and TypeMethod and Description
public PositionList.Entry

Returns:

non-null; element at that index
get
(int
>= 0, < size(); which index
n
)

Gets the element at the given index.

public static PositionList

Returns:

non-null; the positions list
make
(DalvInsnList
non-null; instructions to convert
insns
,
int
how much information should be included; one of the static constants defined by this class
howMuch
)

Extracts and returns the source position information out of an instruction list.

public void
set(int
>= 0, < size(); which index
n
,
PositionList.Entry
non-null; the entry to set at n
entry
)

Sets the entry at the given index.

Inherited from org.droidparts.dexmaker.dx.util.FixedSizeList:
equalsget0getOrNull0hashCodeset0shrinkToFitsizetoHumantoHumantoStringtoString

Field Detail

EMPTYback to summary
public static final PositionList EMPTY

non-null; empty instance

IMPORTANTback to summary
public static final int IMPORTANT

constant for make to indicate that only "important" position information should be returned. This includes block starts and instructions that might throw.

LINESback to summary
public static final int LINES

constant for make to indicate that only line number transitions should be returned

NONEback to summary
public static final int NONE

constant for make to indicate that no actual position information should be returned

Constructor Detail

PositionListback to summary
public PositionList(int size)

Constructs an instance. All indices initially contain null.

Parameters
size:int

>= 0; the size of the list

Method Detail

getback to summary
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:int

>= 0, < size(); which index

Returns:PositionList.Entry

non-null; element at that index

makeback to summary
public static PositionList make(DalvInsnList insns, int howMuch)

Extracts and returns the source position information out of an instruction list.

Parameters
insns:DalvInsnList

non-null; instructions to convert

howMuch:int

how much information should be included; one of the static constants defined by this class

Returns:PositionList

non-null; the positions list

setback to summary
public void set(int n, PositionList.Entry entry)

Sets the entry at the given index.

Parameters
n:int

>= 0, < size(); which index

entry:PositionList.Entry

non-null; the entry to set at n

org.droidparts.dexmaker.dx.dex.code back to summary

public Class PositionList.Entry

extends Object
Class Inheritance

Entry in a position list.

Field Summary

Modifier and TypeField and Description
private final int
address

>= 0; address of this entry

private final SourcePosition
position

non-null; corresponding source position information

Constructor Summary

AccessConstructor and Description
public
Entry(int
>= 0; address of this entry
address
,
SourcePosition
non-null; corresponding source position information
position
)

Constructs an instance.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

>= 0; the address
getAddress
()

Gets the address.

public SourcePosition

Returns:

non-null; the position information
getPosition
()

Gets the source position information.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

addressback to summary
private final int address

>= 0; address of this entry

positionback to summary
private final SourcePosition position

non-null; corresponding source position information

Constructor Detail

Entryback to summary
public Entry(int address, SourcePosition position)

Constructs an instance.

Parameters
address:int

>= 0; address of this entry

position:SourcePosition

non-null; corresponding source position information

Method Detail

getAddressback to summary
public int getAddress()

Gets the address.

Returns:int

>= 0; the address

getPositionback to summary
public SourcePosition getPosition()

Gets the source position information.

Returns:SourcePosition

non-null; the position information